FXSend/MobsetHttp/Poco编译方法.txt
2025-02-28 17:05:50 +08:00

102 lines
3.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Poco 帮助文档:https://pocoproject.org/docs/
Jason, Object.h文件有个Bug需要修改
inline void Object::setEscapeUnicode(bool escape)
{
_escapeUnicode = false;
}
改为: _escapeUnicode = true;
2022.03.11 编译方法
1、没修改Jason, Object.h文件。
2、分别打开以下几项目修改windows sdkdebug,release,x64各个子类分别编译。
CppUnit
Foundation
Encodings
XML
JSON
Util
Net
Crypto
NetSSL_OpenSSL
NetSSL_Win
PageCompiler
PageCompiler/File2Page
Crypto、NetSSL_OpenSSL这两个项目加入openssl库及Crypt32.lib
1、项目属性-VC++目录包含目录添加Openssl include文件夹
2、项目属性-VC++目录库目录添加Openssl库文件夹并且将libcrypto64MT.lib改名为libcrypto.liblibssl64MT.lib改名为libssl.lib其它文件可删除。
3、debug_shared,release_sheard这两个项目项目属性 - 链接器 - 输入 - 附加依赖项 中加入: Crypt32.lib
打开 VS 2017 的X86_X64兼容工具命令提示
buildwin 150 build all both x64 nosamples notests
buildwin 140 build all both Win32 nosamples notests
单独编译其中一个打开components修改项目components
Win32的只能编译140版本
CryptoNetSSL 需要使用vs打开相应的sln文件增加附加库路径与附件输入项
..\openssl\build\lib64
;crypt32.lib;libcryptoMT.lib;libsslMT.lib;
使用vs直接编译
buildwin 140 build static_mt both Win32 nosamples notests
buildwin 140 build static_mt both x64 nosamples notests
buildwin 140 build static_md both Win32 nosamples notests
buildwin 140 build static_md both x64 nosamples notests
buildwin 140 build shared both Win32 nosamples notests
buildwin 140 build shared both x64 nosamples notests
第一种方法:
1 Poco 根目录下有build_vs100.cmd和buildwin.cmd这两个批处理文件, 我们得修改一下它们。
把build_vs100.cmd 修改为以下内容:
@echo off
if defined VS100COMNTOOLS (
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vsvars64.bat")
buildwin 100 build all both x64 samples
红色的部分是vsvars64.bat的路径具体要看本机的安装位置。这里因为是要编译X64所以要修改环境。
蓝色部分是执行编译时候的参数注意X64的X要小写。参数的具体说明为
buildwin VS_VERSION [ACTION] [LINKMODE] [CONFIGURATION] [PLATFORM] [SAMPLES] [TESTS] [TOOL]
VS_VERSION: 71|80|90|100|110
ACTION: build|rebuild|clean
LINKMODE: static_mt|static_md|shared|all
CONFIGURATION: release|debug|both
PLATFORM: Win32|x64|WinCE
SAMPLES: samples|nosamples
TESTS: tests|notests
TOOL: devenv|vcexpress|msbuild
具体的参数选择根据需求。
如果不需要 NetSSL_OpenSSL 和 MySQL ,此时保存后就双击它就行了。 它会自动编译好各种库。
如果要NetSSL_OpenSSL 这个库则打开buildwin.cmd文件:
设置 openssl 的路径,如:
set OPENSSL_DIR=c:\OpenSSL-Win64
set OPENSSL_INCLUDE=%OPENSSL_DIR%\include
set OPENSSL_LIB=%OPENSSL_DIR%\lib;%OPENSSL_DIR%\lib\VC
set INCLUDE=%INCLUDE%;%OPENSSL_INCLUDE%
set LIB=%LIB%;%OPENSSL_LIB%
注意,如果要 Poco 中的 MySQL 库 还得安装. Mysql
编辑好后,双击 build_vs100.cmd执行编译。完成后会在Poco根目录下的lib64中看到编译好的库。在bin64中有编译好的dll。
第二种方法(适合熟悉命令行的用户):
按需求修改完buildwin.cmd文件后使用vs2010的Tools中“Visual Studio x64 Win64 命令提示(2010)”命令进入命令行状态。转到Poco所在的根目录直接输入命令
buildwin 100 build all both x64 samples
最后需要注意的地方:
上述方法完成编译后关于Data的MySQL、ODBC、SQLite三个库没有生成原因不详需要单独编译在此以MySQL为例记录一下编译过程。在\Data\MySQL文件夹下找到MySQL_vs100.sln文件打开。
打开的工程是win32的需要改为X64。在C++包含目录中添加本项目的include文件夹例如“C:\poco-1.5.1-all\Data\MySQL\include;”还要添加安装的MySQL的include文件夹例如“C:\Program Files\MySQL\MySQL Server 5.6\include”在库目录中添加所需库的路径例如“C:\Program Files\MySQL\MySQL Server 5.6\lib”。
注意编译MySQL的Poco库必须先安装MySQL。
设置好环境之后就可以选择相应的配置debug or release进行编译。
编译完成后生成的库在Poco根目录下的lib文件夹如果是编译的动态库则动态库在Poco根目录下的bin文件夹。