How to add external libraries to qt4 application c++

后端 未结 1 556
醉话见心
醉话见心 2020-12-31 10:29

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

Thanks :)

相关标签:
1条回答
  • 2020-12-31 10:58

    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

    0 讨论(0)
提交回复
热议问题