Compile Poco with MinGW on Windows

后端 未结 5 586
后悔当初
后悔当初 2020-12-06 14:19

I need to compile poco with MinGW so I can use it in Qt Creator but cannot figure out how to, I\'ve managed to compile poco in Visual Studio but I cannot use those libraries

5条回答
  •  误落风尘
    2020-12-06 14:31

    Complementing Cesar's answer (here, instead of adding a comment, for formatting purposes), you need something like this on your .pro file:

    INCLUDEPATH += ""
    LIBS += -L"" -l -l
    

    E.g., in my case, I would have this (for debug builds):

    INCLUDEPATH += "C:/Dev/lib/poco/poco143/Debug/include"
    LIBS += -L"C:/Dev/lib/poco/poco143/lib" -lPocoFoundationd -lPocoUtild
    

    You can then refine this a bit, by creating settings for both debug and release builds:

    LIB_HOME = "C:/Dev/lib/"
    POCO_HOME = $${LIB_HOME}poco/poco143/
    
    # SEE http://www.qtcentre.org/threads/23655-Does-Qt-Creator-understand-debug-release-scopes-in-pro-files
    # OR http://www.qtcentre.org/threads/30430-How-to-set-pro-file-about-debug-and-release
    ####
    CONFIG(debug, debug|release) {
    CONFIG -= debug release
    CONFIG += debug
    }
    
    CONFIG(release, debug|release) {
    CONFIG -= debug release
    CONFIG += release
    }
    ####
    
    debug {
    POCO_DEBUG = d
    POCO_PATH = $${POCO_HOME}Debug
    }
    
    release {
    POCO_DEBUG =
    POCO_PATH = $${POCO_HOME}Release
    }
    
    INCLUDEPATH += "$${POCO_PATH}/include"
    LIBS += -L"$${POCO_PATH}/lib" -lPocoFoundation$${POCO_DEBUG} -lPocoUtil$${POCO_DEBUG}
    

    Hope this helps.

提交回复
热议问题