1

I am trying to compile a project using ImGui however I get these errors:

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   

This is really quite odd because the files USED to be inside a folder called src\vendor but are now in another folder called Dependencies\imgui. It doesn't make sense to me why it is even mentioning a folder called vendor at all? Here are my search directories for #include

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

There is a preprocessor for GLEW but not IMGUI, and there are linker settings for GLEW AND SDL2 but not IMGUI. These are compile errors. What could be the problem?

  • Have a look at `SDL2_IMGUI_TEST` in `D:\Not_Streaming\Commonly_Used\Programming\C++\Projects\SDL2_IMGUI_TEST`. You may have references there to `src\vendor`. – rturrado Feb 09 '21 at 11:09
  • There is no vendor there @rturrado, just `src` –  Feb 09 '21 at 11:15
  • Okay I think I got somewhere, I moved `Main.cpp` out of src, and it gives me an error saying `src\Main.cpp` no such file. SO it seems that its reminence are there and would apply to imgui, but I don't know how to fix that @rturrado –  Feb 09 '21 at 11:17
  • Have a look at this answer from same question in SO: https://stackoverflow.com/a/16428880/260313 TLDR: you may need to clean build your solution. – rturrado Feb 09 '21 at 11:29
  • And keep `Main.cpp` where you had it before. Moving it you just created a new problem so to say :) – rturrado Feb 09 '21 at 11:30
  • I tried that, no luck :( –  Feb 09 '21 at 11:47
  • @rturrado Yes but i mean it definitely shows that there is a problem in VS when I move files from directories. I just don't know how to solve it –  Feb 09 '21 at 11:47
  • Shame :( Have you had a look at the other answers in the link I sent you? Some users suggested editing the `.vcxproj` file directly to remove references to unused files (e.g. in your case, to `src\vendor`). If you don't know exactly what you should change or remove you can paste your `.vcxproj` file as part of your question. – rturrado Feb 09 '21 at 11:54
  • yeah, i tried everything on that page. only thing that worked was redoing the entire solution in a new folder :(). Thanks for you help though @rturrado –  Feb 10 '21 at 00:18
  • Thanks! Fair enough that you got it working. Well done! – rturrado Feb 10 '21 at 15:26

0 Answers0