You don't "link" a header file or link to a folder. You link compiled object files (e.g. main.o or floober.obj) and libraries (e.g. x.lib or libx.a) together to make the final executable. This magic is done by a thing called a linker. Qmake, when used correctly, sets all this up for you based on the rules you give it in the PRO file. The linker is given the object files that result from compiling all the SOURCES. It is also given the names of libraries (collections of object files) to link with through -l (lowercase-L) options in the LIBS variable. If the libraries are not in the standard locations then you can supply extra paths to be searched by giving -L options in LIBS.
Linking has nothing to do with includes or INCLUDEPATH: that is used in the preceding compilation stage.
If you have built a DLL project into folder /some/path/X then there will be project.dll and project.lib/libproject.a (exact names depend on compiler type) in that folder. To link your application object files with that library you use:
LIBS += -L/some/path -lproject
LIBS += -L/some/path -lproject
To copy to clipboard, switch view to plain text mode
If you simply want to put some sources in a subfolder but build them directly into your project then you do that with:
HEADERS += subfolder/thingy.h subfolder/another.h
SOURCES += subfolder/thingy.cpp subfolder/another.cpp
HEADERS += subfolder/thingy.h subfolder/another.h
SOURCES += subfolder/thingy.cpp subfolder/another.cpp
To copy to clipboard, switch view to plain text mode
The LIBS variable is not required because these files will be compiled into individual object files and linked automatically by the Makefile that qmake produces.
Bookmarks