I am trying to compile a project on my system using qmake. Some project dependencies are not installed, but are in my home directory, something like this: libs: files /home/myusername/local/lib, and my includes the directory /home/myusername/local/include. Inside the include directory, I have a folder qjsonwith the necessary headers from the library. In the lib folder I have files libqjson.so libqjson.so.0 libqjson.so.0.7.1.
My qmake project project looks something like this:
linux-g++ {
INCLUDEPATH += /home/myusername/local/include/
LIBS += -L/home/myusername/local/lib/ -lqjson
}
and the generated makefile will create commands like this:
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB \
-DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I../qbuzz \
-I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui \
-I/usr/include/qt4 -I/home/myusername/local/include/ -I. -I. -I../myproject -I. \
-o qbuzz-result.o ../myproject/myfile.cc
It is clear that the my include directory is in the -Igcc option . myfile.cccontains include, like this one:
#include <qjson/parser.h>
However, after running make, I get an error message:
../myproject/myfile.cc:2:26: fatal error: qjson/parser.h: No such file or directory
compilation terminated.
, CPLUS_INCLUDE_PATH, include, , :
/usr/bin/ld: cannot find -lqjson
collect2: ld returned 1 exit status
, :
g++ -omyprogram main.o mainwindow.o myfile.o moc_mainwindow.o -L/usr/lib \
-L/home/myusername/local/lib/ -lqjson -lQtGui -lQtNetwork -lQtCore -lpthread
LIBRARY_PATH. , , , -L -I?
Windows MinGW g++.