JoeyDeVries / LearnOpenGL

Code repository of all OpenGL chapters from the book and its accompanying website https://learnopengl.com
https://learnopengl.com
Other
10.89k stars 2.79k forks source link

mismatched header files and libs causes seg fault #376

Open shi-yan opened 9 months ago

shi-yan commented 9 months ago

This project has a strange setup.

it ships with assimp headers, but expect to use the prebuilt assimp binaries installed by the system. This will result in mismatched version of headers and libs.

with the latest assimp 5 installed via brew on mac, I experienced a crash. My fix was removing the included assimp headers and only use the system install.

JoeyDeVries commented 9 months ago

Yeah, it's a bit of a weird situation. Pre-built binaries are supplied for windows users, but not for OS X and Linux users as they're it's preinstalled. Then for windows users it should include the headers as well, but then causes a mismatch on OSX/Linux. A PR was set up that fixes this on OSX/Linux, but breaks on Windows: https://github.com/JoeyDeVries/LearnOpenGL/pull/374

Maybe it's possible to set up CMake s.t. it won't use the shipped headers in case of OSX/Linux, but does support them on Windows, then it could work?

shi-yan commented 9 months ago

I think that works, or using cmake's external project to build everything from source?

https://cmake.org/cmake/help/latest/module/ExternalProject.html