本文介绍了如何添加外部库到qt4应用程序c ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是最好的方式添加额外的编译库到我的qt项目?
例如boost或poco库?
what is the best way to add additional compiled libraries to my qt project ?For example boost or poco libs ?
感谢:)
推荐答案
如果您使用的是GCC编译器,请在.pro文件中添加如下内容:
If you're using the GCC compiler add something like this to the .pro file:
对于Boost:
INCLUDEPATH += d:/Biblioteki/C++/boost/boost_1_44_0a
LIBPATH += d:/Biblioteki/C++/boost/boost_1_44_0a/stage/lib
LIBS += -lboost_system-mgw44-mt-d-1_44
LIBS += -lboost_filesystem-mgw44-mt-d-1_44
LIBS += -lboost_date_time-mgw44-mt-d-1_44
For Poco:
For Poco:
INCLUDEPATH += d:/Biblioteki/C++/Poco/poco-1.3.6p2-mingw-qt2/include
LIBPATH += d:/Biblioteki/C++/Poco/poco-1.3.6p2-mingw-qt2/lib
LIBS += -lPocoFoundationd
LIBS += -lPocoNetd
LIBS += -lPocoUtild
LIBS += -lPocoXML
INCLUDEPATH
- 是具有头文件的目录的位置
LIBPATH
- 是具有* .a文件的目录的位置
LIBS
- 包含您要在应用程序中使用的库列表
INCLUDEPATH
- is the location of directory with header filesLIBPATH
- is the location of directory with *.a files LIBS
- contains list of libraries you want to use in your application
这篇关于如何添加外部库到qt4应用程序c ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!