Unsolved Undefined reference to qDebug
-
Did you also installed Qt from your distribution ?
-
@kshegunov you are linking with wrong libraries. You might have installed Qt from your package manager. So its linking with your program since linker is finding that before the actual libraries. If you are using Qt Creator go to projects tab and chanch path variable. Or uninstall Qt installed using your package manager
-
@SGaist just saw your post. I am thinking the same
-
-
I am not getting clearly. I download my qt set up from qt website and use the same script for installation.
Thanks and Regards
Ayush -
Hi,
I didn't install QT from package manager but ran the executable from the set up which I obtained/downloaded from the QT website.
Secondly I am also using Google test framework for testing my project but that is not causing any problem.
I want to know why including cpp unit library and headers in the .pro file is causing the linking error? -
Could you check if you have libQt5*.so in any other place than /home/mistral/Qt/5.5/gcc_64/lib
-
This thread got really confusing.
@asanka424
I'm not linking anything, it's in fact Ayush who's having trouble.@ayush_mistral
Make sure you're running theqmake
that came with the package you installed, and not a system-wide installed one. That's what's @SGaist was implying with his question, however it seems you do indeed./home/mistral/Qt/5.5/gcc_64/bin/uic
this looks exactly as I'd expect. I don't think your problem is related to the cpp unit library as I mentioned before. Besides runningqmake
again to recreate the project I'm running out of ideas ...Kind regards.
-
Hi,
There are some common libQt5*.so files also present in the path /usr/lib/x86_64-linux-gnu
Thanks and Regards
Ayush -
@ayush_mistral
Okay, then this: "Make sure you're running the qmake that came with the package you installed, and not a system-wide installed one." is quite relevant.
Use theqmake
that came with the package you installed. You can find it somewhere in the/home/mistral/Qt/.../bin
folder. You go to your project, runmake clean
, then use the correctqmake
to create theMakefile
anew, and then youmake
your project again.Kind regards.
-
Hi I found the qmake executable in the path Qt5.5/gcc_64/bin folder
Can you please tell me which tab should I change in qt projects tab to provide the path for the appropriate qmake?
-
@ayush_mistral
Actually you set up a kit for QtCreator and then change the kit for your project. To make your kit work with the Qt you've downloaded just specify the correctqmake
executable and a name that you'd recognize.
The kit your project uses is on the projects page, up-most, just below the name of the project. You have the kit name there and under it two buttons - build and run. Pointing at the kit name ("Qt 5.6 64 bit" in my case) will cause a down arrow to show next to the text. Clicking the arrow there's a context menu that has Change kit on it, and you just select the one you like. After changing the kit, do a full rebuild of your project.Kind regards.
-
Hi,
I have the following settings in the newly created kit
Name- cppunit_qt
Device type - desktop
Device - Local PC
Compiler - GCC (x86 64bit in /usr/bin)
Debugger - System GDB at /usr/bin/gdbTry to make clean and rebuild the project still the error is the same
Can you please tell me if I am missing something or doing something wrong?Thanks and Regards
Ayush
Qt Version - Qt5.5.1GCC 64bit -
@ayush_mistral Which Qt version did you set in that kit?
-
I set 5.5.1
-
@ayush_mistral
But with whichqmake
that is? If you go to the "Manage kits" page and look at the "Qt versions" tab you see that there's a qmake location column. You'd want to have the version you use to match theqmake
you have in the manually installed directory. I have the following table:Auto-detected Qt 5.5.1 in PATH (System) /usr/bin/qmake Manual Qt 5.6.0 (qt5) /home/nye/Programming/C++/qt/qt-5.6/qtbase/bin/qmake Qt 5.7.0 (qt-dev) /home/nye/Programming/C++/qt/qt-dev/qtbase/bin/qmake
Any of those can be used to make a kit, however in your case you need to make sure to use the one you installed from the SDK package.
Kind regards.
-
@kshegunov sorry I was replyin from my phone and seems like reply gone to you.
-
Hi,
In the QT versions tab of my newly created kit the path for the qmake is the same in the manually installed directory (/mistral/QT/5.5/gcc_64/bin/qmake). I also tried to change the qmake and added in the QT version present in path /usr/bin/qmake but still the error is same
Thanks and Regards
Ayush -
@ayush_mistral
Hello,In the QT versions tab of my newly created kit the path for the qmake is the same in the manually installed directory (/mistral/QT/5.5/gcc_64/bin/qmake)
This should be okay. I honestly am out of ideas ...
Kind regards.
-
Spotting your earlier post ...
"There are some common libQt5.so files also present in the path /usr/lib/x86_64-linux-gnu"
Since all ideas are exhausted I will venture a suggestion (as a beginner). A fresh installation.
...
When I migrated from Qt4 to Qt 5.5.1 I got myself in quite a stew with conflicts with legacy Qt libraries. So I decided to start afresh.
I purged all old versions of Qt 4 and Qt 5.
I purged remaining libraries in /usr/lib/x86_64-linux-gnu (actually mine were in x86_32-linux-gnu)
I installed Qt 5.5.1 using workflow here ...https://launchpad.net/~beineri/+archive/ubuntu/opt-qt551-trusty
and followed some other threads
http://askubuntu.com/questions/279421/how-can-i-install-qt-5-x-on-12-04-lts
ftp://ftp.oregonstate.edu/.2/lfs-website/blfs/view/svn/x/qt5.html
I ran command .. qmake --version
(see options by running command .. man qmake)
QMake version 3.0
Using Qt version 5.5.1 in /opt/qt55/libqtchooser -print-env
QT_SELECT="default"
QTTOOLDIR="/opt/qt55/bin"
QTLIBDIR="/opt/qt55/li"I edited ~/.profile as follows (two lines)
export QT5PREFIX="/opt/qt55"
export LD_LIBRARY_PATH="/opt/qt55/bin":${LD_LIBRARY_PATH}I checked and edited the paths in Qt Creator
And I was then out of my conflicts mess.
But this is just a hunch that you have conflicts as I did.
I would put your Qt 5.5.1 installation in /opt/qt55