I did a CMake project, using ImGui and GLFW libraries, and everything works fine and run correctly.
But when I try to create a new one with the same CMakeLists.txt and same including of headers, there are two E1696 errors:
- cannot open source file "imgui_impl_glfw.h"
- cannot open source file "imgui_impl_opengl3.h"
My CMakeLists.txt from not-working project:
find_package(imgui CONFIG REQUIRED)
find_package(glfw3 3.3 CONFIG REQUIRED)
find_package(gl3w CONFIG REQUIRED)
find_package(OpenGL REQUIRED COMPONENTS OpenGL)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE unofficial::gl3w::gl3w)
target_link_libraries(main
PRIVATE imgui::imgui)
target_link_libraries(main
PRIVATE glfw)
target_link_libraries(main
PRIVATE OpenGL::GL)
How I include libraries:
#include <stdio.h>
#include <imgui.h>
#include <imgui_impl_glfw.h>
#include <imgui_impl_opengl3.h>
#include <GL/gl3w.h>
#define GL_SILENCE_DEPRECATION
#if defined(IMGUI_IMPL_OPENGL_ES2)
#include <GLES2/gl2.h>
#endif #define GLFW_INCLUDE_NONE #include <GLFW/glfw3.h>
Downloaded triplets are x64 and build is in x65-Debug mode.
I checked all CMake and vcpkg global parameters in systems and restore project cache, because I thought problem might be in broken vcpkg roots, but it doesn't help. I remake project several times, from VS template for CMake project and as just a folder which I opened in Visual Studio, but results are still the same.