英文:
How do I compile cmake generated binaries in 64bits using MinGW (Windows, GCC)?
问题
我一直在尝试使用cmake和MinGW编译模型加载库Assimp,但是我不知道如何为我正在使用的64位项目进行编译。我使用了命令"mingw32-make",但如果我理解正确,这是用于32位的,当我尝试使用得到的DLL运行我的项目时,它会无提示退出。我听说当你尝试将32位文件与64位项目链接时,可能会发生这种情况。我听说过"make.exe",但我不知道它是否是我需要的,而且无论如何我在我的MinGW文件夹中找不到它。我宁愿不使用Visual Studio,我使用VSCode。
英文:
I've been trying to compile the model loading library Assimp for my project using cmake and then MinGW. However, I don't know how to do that for 64bits which is what I'm using on my project. I used the command "mingw32-make" but if I understand correctly that is for 32bits and when I try to run my project with the obtained DLL it exits without explanation. I've heard this can happen when you try to link 32bit files with a 64bit projects. I heard about "make.exe" but I don't know if it's what I need and either way I can't find it in my MinGW folder. I'd rather not resort to Visual Studio, I use VSCode.
答案1
得分: 0
解决方案很简单:只需获取最新版本,为win64生成make文件,并自行构建:
cd <assimp-source>
cmake CMakeLists.txt -G 'MinGW Makefiles'
cmake --build .
如果你不知道你的mingw-toolchain cmake生成器的名称,你可以查看cmake的帮助文档:
cmake --help
只需查找MinGW相关内容,并将列出的名称添加到cmake -G选项中。
希望这能帮助你解决问题。
英文:
The solution is simple: just get the latest release, generate the make files for win64 and build it by yourself:
cd <assimp-source>
cmake CMakeLists.txt -G 'MinGW Makefiles'
cmake --build .
If you don't know how your mingw-toolchain cmake generator is called you can check the cmake help for that:
cmake --help
Just check for the MinGW stuff and add the listed name for the cmake -G option.
Hope that helps you a little bit to get around your issues.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论