0x00. 编译步骤
- 环境准备
- Microsoft Visual Studio 17.8.4
- cmake-3.29.0
- vcpkg
- 工作目录(例:
D:/workshop
)
-
依次执行下列命令
$ cd /d/workshop $ wget https://github.com/ttttupup/wxhelper/archive/refs/tags/3.9.10.19-v1.zip $ unzip wxhelper-3.9.10.19-v1.zip $ cd wxhelper-3.9.10.19-v1 $ cd app/3rdparty $ git clone https://github.com/microsoft/Detours.git $ git clone https://github.com/nlohmann/json.git $ git clone https://github.com/huzhenjie888/spdlog.git $ cd ../.. $ cp cmake/detours.cmake app/3rdparty/Detours/CMakeLists.txt $ mkdir build $ cd build $ cmake -DCMAKE_C_COMPILER=cl.exe \ -DCMAKE_CXX_COMPILER=cl.exe \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=D:/wxhelper/out/install/x86-debug \ -DCMAKE_TOOLCHAIN_FILE:FILEPATH=D:/workshop/vcpkg/scripts/buildsystems/vcpkg.cmake \ -SD:/workshop/wxhelper-3.9.10.19-v1 \ -BD:/workshop/wxhelper-3.9.10.19-v1/build/x86-debug\ -G Ninja $ cd x86-debug-G $ cmake --build .
-
使用Visual Studio打开
D:/workshop/wxhelper-3.9.10.19-v1/build/x86-debug-G/app.sln
,生成解决方案 -
目标文件
wxhelper.dll
位于D:/workshop/wxhelper-3.9.10.19-v1/build/x86-debug-G/app/wxhelper/lib/Debug
0x01. 注意事项
-
C2039 “unordered_map”: 不是 “std” 的成员
修改
app/wxhelper/src/http_router.h
文件,引入unordered_map
#include <unordered_map>
-
C2065 “MG_EV_HTTP_CHUNK”:未声明的标示符,则修改mongoose.h,增加MG_EV_HTTP_CHUNK枚举类型
MG_EV_HTTP_CHUNK, // HTTP chunk (partial msg) struct mg_http_message *