I keep getting below error during build at #include <assimp/Importer.hpp>
Error: C1083: Cannot open include file: 'assimp/Importer.hpp': No such file or directory
I have tried to clean the solution, rebuild, updated it with the fullpath, nothing is working.
I have been working and building my OpenGL project in Debug-Win32, I wanted to load models, so came across Assimp. Since they do not release the builds anymore, I downloaded the latest release v5.4.3 from GitHub and followed below to build it locally.
- Open command promt, and run
cmake .\CMakeLists.txt
- Once completed, you should be able to see a
Assimp.sln
- Open the
Assimp.sln
and selectedDebug
and it was available forx64
only - Once done, copied the generated
lib
andbin
to my project
Project Setup:
Visual Studio 2022
Initially I was using Win32
, but since I didnt get latest versions of assimp in win32, I reconfigured project to run on x64 as well, added relevant GLEW, GLFW paths and I was able to run application without any issues.
I added the assimp files to my Dependencies
. And then added below configurations:
Include Directory Settings (C/C++ -> General -> Additional Include Directories)
src
src\vendor
Core
$(SolutionDir)Dependencies\GLFW\include
$(SolutionDir)Dependencies\GLEW\include
$(SolutionDir)Dependencies\assimp\include
Verified that $(SolutionDir)Dependencies\assimp\include
is actually pointing to correct path.
Library Directories & Linking
- Linker -> General -> Additional Library Directories:
$(SolutionDir)Dependencies\GLFW\lib-vc2022
$(SolutionDir)Dependencies\GLEW\lib\Release\x64
$(SolutionDir)Dependencies\assimp\lib\Debug
- Linker -> Input -> Additional Dependencies:
assimp-vc143-mtd.lib
glew32s.lib
glfw3.lib
opengl32.lib
User32.lib
Gdi32.lib
Shell32.lib
Why is Visual Studio not finding assimp/Importer.hpp despite it being in the include directory? Is there something wrong with my configuration?
Directory Structure of Assimp
Dependencies/assimp/
├───Debug
├───Dependencies
│ ├───assimp
│ │ ├───bin
│ │ │ └───Debug
│ │ ├───include
│ │ │ └───assimp
│ │ │ ├───Compiler
│ │ │ └───port
│ │ │ └───AndroidJNI
│ │ └───lib
│ │ └───Debug
│ ├───GLEW
│ │ ├───doc
│ │ ├───include
│ │ │ └───GL
│ │ └───lib
│ │ └───Release
│ │ ├───Win32
│ │ └───x64
│ └───GLFW
│ ├───include
│ │ └───GLFW
│ └───lib-vc2022
└───OpenGL
├───Core
├───res
└───src (Application.cpp/main)
├───tests
└───vendor
├───glm
├───imgui
└───stb_image