在Windows上使用MinGW编译Poco [英] Compile Poco with MinGW on Windows

查看:539
本文介绍了在Windows上使用MinGW编译Poco的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用MinGW编译poco,以便可以在Qt Creator中使用它,但无法弄清楚如何,我设法在Visual Studio中编译了poco,但是我不能在Qt Creator中使用这些库.

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 in Qt Creator.

推荐答案

为补充塞萨尔(Cesar)的答案(在此,为格式设置目的,而不是添加注释),您需要在.pro文件中添加以下内容:

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

INCLUDEPATH += "<path_to_poco_include_dir>"
LIBS += -L"<path_to_poco_lib_dir>" -l<poco_lib> -l<poco_lib>

例如,在我的情况下,我将拥有此(用于调试版本):

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}

希望这会有所帮助.

这篇关于在Windows上使用MinGW编译Poco的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆