最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c++ - Visual Studio 2022 OpenGL Project: 'assimpImporter.hpp' Not Found Despite Correct Include Path - Stack Ove

programmeradmin5浏览0评论

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

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论