Open atorber opened 3 months ago
编译器架构是x86,用x64的编译器
是按以下操作说明执行的:
环境: cl.exe目录= c:/cl.exe
ml64.exe目录 =c:/ml64.exe
vcpkg目录 = c:/vcpkg wxhelper目录 = c:/wxhelper
cd wxhelper/app/3rdparty
git clone https://github.com/microsoft/Detours.git
git clone https://github.com/gabime/spdlog.git
git clone https://github.com/nlohmann/json.git
或者使用vcpkg 安装相应库
vcpkg install detours:x64-windows
vcpkg install nlohmann-json:x64-windows
vcpkg install spdlog:x64-windows
cd wxhelper/cmake
copy detours.cmake wxhelper/app/3rdparty/Detours/CMakeLists.txt
cd wxhelper
mkdir build
cd build
cmake -DCMAKE_C_COMPILER=cl.exe \
-DCMAKE_CXX_COMPILER=cl.exe \
-DCMAKE_ASM_MASM_COMPILER=ml64.exe \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=C:/wxhelper/install/x64-debug \
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \
-SC:c:/wxhelper \
-BC:c:/wxhelper/build/x64-debug\
-G Ninja
cmake --build ..
自动就变成 C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx86/x86/cl.exe
不知道如何修改了
这里的 cl.exe目录= c:/cl.exe ml64.exe目录 =c:/ml64.exe 是需要把这两个exe copy到c盘吗?这里是不是该通过设置环境变量调用本机的程序呢?
首先,确保你的系统已经安装了cmake和Ninja构建系统,并且cl.exe和ml64.exe路径正确。
切换到wxhelper
项目里的3rdparty
目录,并克隆相关的依赖库:
cd c:/wxhelper/app/3rdparty
git clone https://github.com/microsoft/Detours.git
git clone https://github.com/gabime/spdlog.git
git clone https://github.com/nlohmann/json.git
或者使用vcpkg安装这些依赖库:
c:/vcpkg/vcpkg install detours:x64-windows
c:/vcpkg/vcpkg install nlohmann-json:x64-windows
c:/vcpkg/vcpkg install spdlog:x64-windows
将Detours的CMake配置文件复制到正确位置:
cd c:/wxhelper/cmake
copy detours.cmake c:/wxhelper/app/3rdparty/Detours/CMakeLists.txt
为wxhelper
项目创建一个构建目录:
cd c:/wxhelper
mkdir build
cd build
配置项目:
注意:cmake路径中的大小写需要与实际路径匹配。
cmake -DCMAKE_C_COMPILER=c:/cl.exe \
-DCMAKE_CXX_COMPILER=c:/cl.exe \
-DCMAKE_ASM_MASM_COMPILER=c:/ml64.exe \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=c:/wxhelper/install/x64-debug \
-DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake \
-Hc:/wxhelper \
-Bc:/wxhelper/build/x64-debug \
-G "Ninja"
构建项目:
cmake --build c:/wxhelper/build/x64-debug
请确保替换命令中的路径以匹配你的环境。
以上是使用gpt4优化后的步骤,可以在此基础上优化后更新
这个报错怎么解决啊
这个报错怎么解决啊
同样卡在这里,哪位大佬,方便的话,指点一下,感谢~!
这个报错怎么解决啊
同样卡在这里,哪位大佬,方便的话,指点一下,感谢~!
@ttttupup 大佬,有空,帮忙解答一下,感谢~!
编译失败