[CMake] Qt 4.3.0 - Relinking causes unresolved symbol errors

Alexander Neundorf a.neundorf-work at gmx.net
Wed Jun 6 08:23:49 EDT 2007


On Wednesday 06 June 2007 04:06, Matthew Smith wrote:
> Hi everyone,
>
> I recently downloaded the source for Qt 4.3.0 and did a sandboxed local
> installation - i.e. /usr/local/Trolltech/Qt-4.3.0/ rather than
> installing the libs to the usual library directory.  I configured and
> compiled my application QTM, and then installed it to /usr/local/bin.
> It failed, with this error:
>
> /usr/local/bin/qtm: symbol lookup error: /usr/local/bin/qtm: undefined
> symbol: _ZN9QListData7detach2Ev
>
> When running it from the build directory, it ran fine.  It turns out
> that, when installing, it relinks the program, causing it to source qt
> at /usr/lib, which is where the Ubuntu packages of Qt 4.2.3 are
> installed.  Since QTM uses Qt 4.3 features if compiled with Qt 4.3, it
> fails.
>
> When building on SUSE 10.2 with SUSE's own downloadable RPMs of Qt 4.3,
> this behaviour is not replicated, nor is it when using the same version
> of CMake (2.4.6) on the Mac, with a similar sandboxed install of Qt 4.2.
>   It seems only to affect sandboxed installs of Qt 4.3.
>
> How can I get rid of this relinking behaviour?  Surely, if you install a
> program having compiled it from source, you should expect it to link the
> same libraries as when you compiled it.

When it gets relinked, I think the default is to relink it without RPATH. You 
need to setup RPATH, see the various properties in SET_TARGET_PROPERTIES(). 

Bye
Alex


More information about the CMake mailing list