Looking at what you have here, I’d say that GLFW headers should have been discovered, so I got curious and tried to reproduce your problem, but I could not (with CMake 3.29.2). The project of course fails on linking, because you are missing linking to GLFW binary, but I did not get your error about the header.
So it is probably something environmental, such as you are on a case-sensitive filesystem, and your GLFW headers folder is actually named glfw.
If you want, I could try to reproduce it with your exact project files, so if you’d be interested in that, share an archive or repository here.
Okay, I tried to reproduce the headers problem with the project from your repository, but it’s the same as the one that I tried to re-create based on your original description, so I did not get that error still.
Just in case, here are the commands that I executed:
[2/2] Linking CXX executable cpp
FAILED: cpp
Undefined symbols for architecture arm64:
"_glfwCreateWindow", referenced from:
_main in main.cpp.o
ld: symbol(s) not found for architecture arm64
Like I already said, the linking error is expected, because you don’t link to GLFW in your project. But why you get the headers error - that I don’t understand. The only difference I can immediately see between our environments is that I’m on Mac OS and you seem to be on Windows (with MSYS/MinGW?), although that shouldn’t matter.
Just in case, I tried on Windows too, but got the same result:
main.cpp.obj : error LNK2019: unresolved external symbol glfwCreateWindow referenced in function main
cpp.exe : fatal error LNK1120: 1 unresolved externals
I don’t see a single target_link_libraries() in your project.
So then what do you mean by “i linked it”? Can you show the exact line/fragment which you think does the linking in your project?
If you mean your original error about missing header - like I said, that problem I could not reproduce, so I can’t say what could be causing it on your side. Maybe someone else can.