Registered Member
|
I have arch linux with the latest upgrade
Kdevelop 4.5.0 with qt4 and qt5 When I try to use qudpsocket i go this message when linking: /usr/bin/ld: CMakeFiles/readpremag.dir/readpremag.o: undefined reference to symbol '_ZN12QHostAddress10setAddressERK7QString' /usr/bin/ld: note: '_ZN12QHostAddress10setAddressERK7QString' is defined in DSO /usr/lib/libQtNetwork.so.4 so try adding it to the linker command line /usr/lib/libQtNetwork.so.4: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status before last upgrade of the system was all ok. I try to change some reference on project configuration between qt4 and qt5 but nothing change. need help to understand. |
Global Moderator
|
Most likely not related to KDevelop. This is a problem in your build system.
If you'd like further help, please provide details about your project, system setup, and post your CMakeLists.txt file(s). Greetings, Sven
I'm working on the KDevelop IDE.
|
Administrator
|
It may also be worth checking that the libQtNetwork.so.4 file has not been corrupted.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Global Moderator
|
I think the message always sounds like this, it's a bit weird. Afaik it just means you got your linker flags wrong.
Still worth checking, of course. Cheers, Sven
I'm working on the KDevelop IDE.
|
Registered Member
|
I add more info:
The system I use is a linux arch-86 with CPU i5 upgraded up to 10/05/2013. This problem appears after the upgrade to new release of qt5. I can get immediately the same problem opening a new project with template qt --> test. At the first compilation, problem appears. You are right, some flags in the configuration are wrong, may be also the mix of qt4 and qt5 is wrong. But where ? Thanks These are the cmake generated automatically.
------------------------------------------------------------------------------------------------------------------------------------------
|
Administrator
|
Ah, mixing Qt 4 and Qt 5 definitely won't work.
What is the output of "qmake -version"?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
The library libQtNetwork.so.4 link to libQtNetwork.so.4.8.4 All other library points to qt.4.8.4 and works fine, sql etc, without the network, in other projects. Cheers Tino |
Administrator
|
Okay, you probably need to adjust your CMakeLists.txt to explicitly link to QtNetwork:
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
qmake-qt4 used for "QT-QMAKE-EXECUTABLE"
give: QMake version 2.01a Using Qt version 4.8.4 in /usr/lib Cheers Tino |
Administrator
|
Okay, that probably means the right libraries are being found hopefully, assuming the linker isn't doing anything silly.
Can you try adjusting the target_link_libraries as noted above?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
This not make changes Cheers Tino |
Administrator
|
It seems something is referencing a "readpremag.o" file - although I see no reference to a "readpremag.c" or "readpremag.cpp" file anywhere in the CMakeLists.txt files you pasted. Please check that any executables, libraries, etc. containing this object file are linked against QtNetwork as was shown in my example. Adding "${QT_QTNETWORK_LIBRARY}" should do the trick.
Also, please check that "/usr/lib/libQtNetwork.so" points to the "/usr/lib/libQtNetwork.so.4.8.4" version of the library, rather than the Qt 5 version, as CMake appears to be referring to the version-less variant of the library.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Forget my first message and look at the "qttest" cmake files and configuration. The error on the link output is the same. "readpremag" is a more complex project. I check the link --> It's ok. Cheers Tino |
Administrator
|
Could you post the qttest.cpp and main.cpp files so I can attempt to compile the code here?
It should work if the target_link_libraries call I posted is being used.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
The real error for this projetc is, very similar to the qtnetwork, there is something in the symbol formation that it's not compatible with the library or (?) :
main.cpp
Qttest.cpp
Qttest.h
thanks tino |
Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, Sogou [Bot]