Adam Majer wrote: > Eirik Ulvik wrote: >> Have you set the correct Qt version in Tools->Options->Qt4? >> >> Eirik >> >> Adam Majer skrev: >>> Using Linux with Qt Creator 1.2.1. I get the following error when trying >>> to compile with a custom Qt library. >>> >>> g++ -m64 -Wl,-rpath ../lib -o gui build/obj/main.o >>> build/obj/main_window.o build/obj/moc_main_window.o -L../lib >>> -L../db/interfaces -L../../lib/qt4 >>> -L/var/tmp/qt/qt-x11-commercial-src-4.5.2/lib -ldb -lgalsoft-gui >>> -lgalsoft-core -lQtGui -L/var/tmp/qt/qt-x11-commercial-src-4.5.2/lib >>> -L/usr/X11R6/lib64 -pthread -lpng -lfreetype -lgobject-2.0 -lSM -lICE >>> -pthread -pthread -lXrender -lfontconfig -lXext -lX11 -lQtCore -lz -lm >>> -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread >>> >>> /usr/lib64/libQtNetwork.so.4: undefined reference to >>> `QObjectPrivate::checkWindowRole()' >>> >>> /usr/lib64/libQtNetwork.so.4: undefined reference to >>> `QDataStream::QDataStream(QByteArray*, int)' > > > Yes, correct version is set in options. Also I've verified correct > version is set by project. The command line adds the required -L. > > gcc version is 4.3.3 (Debian 4.3.3-8) > > Again, the only work around was to add the Qt path to LD_LIBRARY_PATH in > the build options. > > I don't understand why LD_LIBRARY_PATH to Qt is needed during link. > > - Adam
I actually just had the same problem. I was building against Qt 4.2 but my main installation had only Qt 4.0. And I also fixed it by modifying the LD_LIBRARY_PATH. I'm pretty sure the undefined references are for when you actually try to run the program and it uses the .so from the system instead of from where you linked against it. Maybe it should automagically set the LD_LIBRARY_PATH to include the version you link against, although I'm not sure if QtCreator can do that. -- Jonathan Arnold Webstream: http://hieronymus.soup.io Some days you're the dog, some days you're the hydrant. _______________________________________________ Qt-creator mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-creator
