[Qt-interest] how to disable the "lib"

Thiago Macieira thiago at kde.org
Wed Aug 3 15:07:09 CEST 2011


On Wednesday, 3 de August de 2011 14:34:25 Rohan Prabhu wrote:
> QMAKE_POST_LINK = mv libExampleAppOne.so.1.0.0 ExampleAppOne.so && rm
> lib*.so*
> 
> Basically, I let qmake do its thing, then rename the file myself and
> delete the symlinks it creates.

Don't do that.

It renames the file but it does not change the library's SONAME:

$ readelf -d $QTDIR/lib/libQtCore.so.4.8.0 | grep SONAME   
 0x0000000e (SONAME)                     Library soname: [libQtCore.so.4]

When you link an application to a library, the linker will copy the library's 
SONAME to the application's dynamic header:

$ readelf -d $QTDIR/lib/libQtGui.so.4.8.0 | grep QtCore
 0x00000001 (NEEDED)                     Shared library: [libQtCore.so.4]

That's the file that the dynamic linker will search for. So your renaming will 
have no effect: you still need the symlink with the "lib" prefix.

What you really want is:

CONFIG += plugin no_plugin_name_prefix

Plugins don't have sonames.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110803/caf9dcad/attachment.bin 


More information about the Qt-interest-old mailing list