How to add external libraries to qt4 application c++

隐身守侯 提交于 2019-11-29 13:49:55

问题


what is the best way to add additional compiled libraries to my qt project ? For example boost or poco libs ?

Thanks :)


回答1:


If you're using the GCC compiler add something like this to the .pro file:

For 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:

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 - is the location of directory with header files
LIBPATH - is the location of directory with *.a files
LIBS - contains list of libraries you want to use in your application



来源:https://stackoverflow.com/questions/5314735/how-to-add-external-libraries-to-qt4-application-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!