开发者

How to add a folder with multiple libs and a folder with multiple headers into your project with Qt?

开发者 https://www.devze.com 2023-02-04 06:12 出处:网络
So my problem is next: I need to connect to my project Boost, FFMpeg, OpenCV and OpenAL. I have putted all .lib files for tham into some C://libs/ and headers and additional source into C://headers/ a

So my problem is next: I need to connect to my project Boost, FFMpeg, OpenCV and OpenAL. I have putted all .lib files for tham into some C://libs/ and headers and additional source into C://headers/ and C://src/ so I have this 3 folders I will need to cnnect to my project... I am so very new to qt and I am starting to read books on it and stuff but by now I have not found info on connectimg additional libs and source folders for projects...

And If you happen to know how to do what I am asking fore I have one more question - I have a folder called C://dlls/ with dlls I开发者_如何转开发 need to be placed into folder with .exe file how to add such to .pro file?


I found something like

unix:LIBS += -L/usr/lib -lboost_regex
win32:LIBS +=C:/Qt/2010.02.1/qt/lib/libboost_regex.lib

but here they connect a file - not folder and only a lib - no headers=(


For the header files, add the path to the folders to the INCLUDEPATH variable:

INCLUDEPATH += C:/headers/

For the libraries, add them to your LIBs as in your example. You may need to do this one-by-one, or you could set something up for qmake to process the directory and add the given files.

LIBS +=C:/Qt/2010.02.1/qt/lib/libboost_regex.lib

For the source files, if the libraries are properly compiled, you shouldn't need to reference them in your code project. If you do, add them to the sources list like your other code to be compiled.

For the dlls, that is more of an installation problem than a compile problem. However, you might be able to give qmake a post-link command to run to copy the dlls into the same folder as the target executable.

0

精彩评论

暂无评论...
验证码 换一张
取 消