c++cmakemingwmingw-w64assimp

How do I compile cmake generated binaries in 64bits using MinGW (Windows, GCC)?


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.


Solution

  • 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.