0

I was trying to compile a project I checked out from github but I get these errors:

/usr/bin/ld: cannot find -lQtGui
/usr/bin/ld: cannot find -lQtNetwork
/usr/bin/ld: cannot find -lQtCore

It worked before but then I installed some application that pulled in Qt5 and nothing works anymore. How do I diagnose what's wrong or the reason why linker can't find these libraries.

1
  • If it worked previously with Qt4, have you tried setting the QT_SELECT environment variable before starting the build process e.g. export QT_SELECT=qt4? Apr 13, 2016 at 13:52

1 Answer 1

0

If you are building a Qt project, Qt Creator tool may be of use -- it supports multiple Qt versions to be set as build kits, you just need to have the proper compiler installed and locate the qmake file of the desired Qt.

If otherwise you are convinced to build something from command line (ex.: development is not the key goal), check the following:

qmake --version  # which qt
pkg-config --modversion QtCore #module version

And yes, export QT_SELECT = <desired Qt version> also works, when you need to switch versions for you build.

2
  • I did try qt creator and it gives me the same error. Here's my output if that is of any help. pastebin.com/aVXx6kzY Apr 14, 2016 at 0:32
  • Hmm. QT += core gui network in *.pro file ? Or dirty hack: LIBS+=-L"/usr/local/lib" ?
    – MasterAler
    Apr 14, 2016 at 13:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .