You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Win10下VSCode中CMake+MinGW-w64编译Assimp并链接的问题求助

Successfully Compiling & Linking Assimp with CMake + MinGW-w64 on Win10 VSCode?

Hey folks,

First, I wanted to flag a known bug I ran into with newer Assimp versions:

  • Assimp 5.2.5 compiles successfully with MinGW-w64 (gcc 12.2.0) if you disable the ASSIMP_WARNING_AS_ERROR CMake option. But it can't load .obj models that worked perfectly with MSVC-built Assimp—my OpenGL scene just doesn't render the models at all. The Assimp dev team has confirmed this issue and has it on their backlog for the 5.1 release.

Now, onto my own problem that I'm stuck on:

My Environment & Troubleshooting Steps

I'm on Windows 10 using VSCode, trying to integrate Assimp 5.0.1 with OpenGL. My setup includes:

  • CMake 3.17.2
  • MinGW-w64 (gcc/g++ 8.1.0)

I followed the official build instructions to generate MinGW Makefiles via CMake-GUI, but when I ran mingw32-make, the process failed at the 69% stage with a bunch of undefined reference linking errors. It didn't produce the assimp.exe binary, but I did end up with libassimp.dll and libassimp.dll.a in my build directory.

I tried all the standard linking steps:

  • Placed libassimp.dll in my project's executable output path
  • Added the directory with libassimp.dll.a to my library path
  • Included the Assimp header directories in my include path
  • Renamed libassimp.dll.a to libassimpdll.a (to fit VSCode's linker expectations) and added -lassimp to my tasks.json linker flags

But no luck—I'm still getting tons of undefined reference errors when building my project. I also tested other approaches:

  • Compiling Assimp with VS2017 works flawlessly, producing valid dll and lib files
  • Linking the official precompiled Assimp 3.1.1 library also resulted in the same linking errors

Asking for Help

Has anyone out there managed to successfully compile Assimp using CMake + MinGW-w64 on Windows 10 with VSCode, and get it properly linked into an OpenGL project? Any tips or workarounds would be hugely appreciated!

内容的提问来源于stack exchange,提问作者abmin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.07 16:47:46