请解释我做错了什么:
我试图将 GLFW 添加到 Visual Studio 项目中,而不是先将其构建到二进制 .lib 文件中,也就是说,我将整个 GLFW 源文件添加到项目中。
1) 我创建了一个 Visual Studio 2022 项目。
2) 在那里添加了 GLFW 源文件
3)附头文件:
#include <glad/gl.h> #include <GLFW/glfw3.h>
4)添加预处理器定义:
_GLFW_WIN32;
_GLFW_OPENGL_LIBRARY
5)我点击编译,编译器产生了很多错误。
我忘了做什么?忘记添加哪些预处理器定义?或者发生了什么事? :(
PS:以下是编译器抛出的一些错误:
> -C1083 Cannot open include file: X11/cursorfont.h: No such file or directory
> -C2039 "x11": Not a member of "_GLFWlibrary".
> -C4013 DisplayWidthMM: no definition; assumes "extern" with return type "int"
> -C2065 screens: undeclared GLFW identifier
> -C1083 Cannot open include file: unistd.h: No such file or directory
> ....
PS_1:
在文件 GLFW x11_windows.c - GLFW 尝试#include
为什么 GLFW 试图在 Windows 上启用 X11?