首页 > 解决方案 > Microsoft Visual Studio 具有来自以前但不是当前设置的编译错误

问题描述

我正在尝试使用ImGui但是我得到这些错误编译一个项目:

Severity    Code    Description Project File    Line    Suppression State
Error   C1083   Cannot open source file: 'src\vendor\imgui\imgui_widgets.cpp': No such file or directory    SDL2_IMGUI_TEST D:\Not_Streaming\Commonly_Used\Programming\C++\Projects\SDL2_IMGUI_TEST\SDL2_IMGUI_TEST\c1xx    1   
Error   C1083   Cannot open source file: 'src\vendor\imgui\imgui.cpp': No such file or directory    SDL2_IMGUI_TEST D:\Not_Streaming\Commonly_Used\Programming\C++\Projects\SDL2_IMGUI_TEST\SDL2_IMGUI_TEST\c1xx    1   
Error   C1083   Cannot open source file: 'src\vendor\imgui\imgui_demo.cpp': No such file or directory   SDL2_IMGUI_TEST D:\Not_Streaming\Commonly_Used\Programming\C++\Projects\SDL2_IMGUI_TEST\SDL2_IMGUI_TEST\c1xx    1   
Error   C1083   Cannot open source file: 'src\vendor\imgui\imgui_draw.cpp': No such file or directory   SDL2_IMGUI_TEST D:\Not_Streaming\Commonly_Used\Programming\C++\Projects\SDL2_IMGUI_TEST\SDL2_IMGUI_TEST\c1xx    1   
Error   C1083   Cannot open source file: 'src\vendor\imgui\imgui_impl_opengl3.cpp': No such file or directory   SDL2_IMGUI_TEST D:\Not_Streaming\Commonly_Used\Programming\C++\Projects\SDL2_IMGUI_TEST\SDL2_IMGUI_TEST\c1xx    1   
Error   C1083   Cannot open source file: 'src\vendor\imgui\imgui_impl_sdl.cpp': No such file or directory   SDL2_IMGUI_TEST D:\Not_Streaming\Commonly_Used\Programming\C++\Projects\SDL2_IMGUI_TEST\SDL2_IMGUI_TEST\c1xx    1   
Error   C1083   Cannot open source file: 'src\vendor\imgui\imgui_stdlib.cpp': No such file or directory SDL2_IMGUI_TEST D:\Not_Streaming\Commonly_Used\Programming\C++\Projects\SDL2_IMGUI_TEST\SDL2_IMGUI_TEST\c1xx    1   
Error   C1083   Cannot open source file: 'src\vendor\imgui\imgui_tables.cpp': No such file or directory SDL2_IMGUI_TEST D:\Not_Streaming\Commonly_Used\Programming\C++\Projects\SDL2_IMGUI_TEST\SDL2_IMGUI_TEST\c1xx    1   

这真的很奇怪,因为文件曾经位于名为的文件夹src\vendor中,但现在位于另一个名为Dependencies\imgui. 为什么它甚至提到一个名为 vendor 的文件夹对我来说没有意义?这是我的搜索目录#include

$(SolutionDir)Dependencies\imgui
$(SolutionDir)Dependencies\GLEW\include
$(SolutionDir)Dependencies\SDL2\include

GLEW 有一个预处理器,但没有 IMGUI,有 GLEW 和 SDL2 的链接器设置,但没有 IMGUI。这些是编译错误。可能是什么问题呢?

标签: c++visual-studiocompiler-errors

解决方案


推荐阅读