Does the compilation work if you do it from the command line and not from QtCreator?
Does the compilation work if you do it from the command line and not from QtCreator?
I went to the project directory and did the following:
Qt Code:
>qmake sqlite_props.pro >gmakeTo copy to clipboard, switch view to plain text mode
It spits out the following (main.cpp and propertyfile.cpp are the two source files for my project):
Qt Code:
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include -I. -o main.o main.cpp g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include -I. -o propertyfile.o propertyfile.cpp g++ -m64 -Wl,-O1 -o sqlite_props main.o propertyfile.o -L/usr/lib64 -lQtCore -L/usr/lib64 -lpthread /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: warning: libz.so.1, needed by /usr/lib64/libQtCore.so, not found (try using -rpath or -rpath-link) /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: warning: libdl.so.2, needed by /usr/lib64/libQtCore.so, not found (try using -rpath or -rpath-link) /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: warning: librt.so.1, needed by /usr/lib64/libQtCore.so, not found (try using -rpath or -rpath-link) /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: warning: libglib-2.0.so.0, needed by /usr/lib64/libQtCore.so, not found (try using -rpath or -rpath-link)To copy to clipboard, switch view to plain text mode
Cheers,
Craig
Does it work if you add the following entry to the project file?
By the way, how did you install Qt?
Adding the LIBS to the project file did not change any of the error messages.
I installed the libraries included with the distro (openSuse 12.2 ) through Yast.
Checking through my list of installed packages I noticed that I have both libqt4 and libqt4-32bit installed, could this be part of the problem?
Cheers,
Craig
If you use standard repositories and this is happening then I suggest looking if anyone else with openSuse 12.2 had a similar problem. It seems like an issue with distro packages.
I don't think so. The messages clearly indicate you are using 64b libs.Checking through my list of installed packages I noticed that I have both libqt4 and libqt4-32bit installed, could this be part of the problem?
CraigD (3rd October 2012)
Thanks. I am taking my troubles to the openSuse forums.
If I can find out what went wrong I will post here for the education of future generations ...
Cheers,
Craig
With some help on the openSuse form. I seem to have found a solution to my problem, but it looks like it was my mis-use of QtCreator that was the problem.
I added the following lines to my .pro file, after which a call to qmake and gmake did the trick.
Qt Code:
QT += sql LIBS += -lz -ldl -lrt -lglib-2.0 -lpcreTo copy to clipboard, switch view to plain text mode
I am surprised I had to explicitly add the -lz -ldl -lrt -lglib-2.0 -lpcre to my .pro file.
Can anyone explain why it is necessary to specifically link to these libraries which are already in the path.
Perhaps the fact that I didn't initially specify QT += sql caused this.
Anyway, hope this helps if anyone else stumbles across the same problem in the future.
Cheers,
Craig
You shouldn't need to do that unless you are using static libraries.
It's not necessary.Can anyone explain why it is necessary to specifically link to these libraries which are already in the path.
That's very unlikely.Perhaps the fact that I didn't initially specify QT += sql caused this.
Hello Craig,
I ran exactly into the same problem like you and like you I use openSUSE 12.2. But I do not try to build Qt software, I tried to build the media center software XBMC. I get the same errors like you, the linker cannot find libraried, although they are installed on the system.
I get errors like this:
Qt Code:
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: warning: libm.so.6, needed by /usr/lib64/libpython2.7.so, not found (try using -rpath or -rpath-link)To copy to clipboard, switch view to plain text mode
Actually libm.so.6 is there. My guess was the linker in openSUSE is broken. But, the amazing thing is, other folks can build XBMC on openSUSE 12.2, so it leaves me totally clueless.
What would I have to do to adapt your solution to my problem? Actually it seems we have the very same problem, only difference you build Qt code and I try to build XBMC.
addendum
I have now removed all binutil packages that I do not need, e.g. for ARM, IA64 and so on, I only kept binutils for x86_64 and i386 and suddenly I can build the software now! Can this really be the root of the problem? Does having several binutils on the system make the system weird? All I can say it works now, all I did was to remove unneeded binutils.
Thanx
Malte
Last edited by pinguin74; 26th January 2013 at 00:45.
Bookmarks