1

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 selected Debug and it was available for x64 only
  • Once done, copied the generated lib and bin 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
7
  • stackoverflow.com/questions/3162030/… Commented Feb 19 at 15:02
  • I have tried that's as well, still it's unable to locate. And also the Assimp is Solution Dir and not in project Dir(with src).
    – Zoro
    Commented Feb 19 at 17:59
  • Are you sure this is not the usual problem of the VS property page not matching your active configuration? I would adopt CMake for your main build system as well and forget about configuring VS projects.
    – Botje
    Commented Feb 20 at 12:08
  • Is the configuration page active? Visual Studio uses separate configuration pages for Win32 and x64 Commented Feb 20 at 12:35
  • I was thinking of going for cmake, but I'm pretty new to the whole concept and wasn't sure on how to adopt it for existing project. And yes, the active config was set to x64
    – Zoro
    Commented Feb 21 at 7:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.