Issue Linking Assimp Windows 11

79 Views Asked by At

I am having issues with linking assimp in c++ for windows 11. I am working the the LearnOpenGL tutorial however I cannot get assimp to link correctly. I am able to make, and generate the assimp .dll and .lib, and grab the include files without error. I am also able to compile without issue, with just including some assimp headers. However whenever I attempt to use anything from an assimp file, I receive an 'undefined reference to ...' error. My g++ version is 13.2.0 and I am using this command to compile my project, with {project_dir} replaced as the path to the project directory.

g++ -g -std=c++17 -I./include -L./lib {project_dir}\*.cpp {project_dir}\*.c -lglfw3dll -lassimp-vc143-mtd -o myprogram

Here is an picture of the project directory layout.

The exact error results from these lines and the error message given by g++ is: {terminal_exe_location} {file_path} undefined reference to `Assimp::Importer::~Importer()'

I have tried multiple versions of g++, through differing versions of mSys2 and mingw. With no noticeable change in the error message asides from the terminal filepath.

It would be amazing if someone could help me understand what it is I have done wrong in attempting to build / link assimp it would be greatly appreciated. I am fairly inexperience with c++ and building my own binaries so I may not have provided all necessary information, and I can provide any logs / information that is not included upon request.

1

There are 1 best solutions below

0
Maxwell Stevens On

The issue I was facing was that I was linking a bad file, I built assimp using the visual studio compiler which was resulting it in failing to actually find anything in assimp when compiling with g++. The fix here was to just throw out manually making assimp and instead just using MSYS2 binaries instead. Thanks to the help from @HolyBlackCat.