如何将 glfw 库包含到 C++ 项目中?

How do I include the glfw library to a C++ project?

我已经从他们的站点下载了 glfw 源代码,但我不知道从那里去哪里。 我在 linux opensuse.

您可能需要编译代码然后开始使用。

来自Compiling GLFW you get the information below. After that you may follow the quick-guide

正在使用 CMake 命令行工具生成文件 要进行树内构建,请输入 GLFW 源代码树的根目录(即不是 src 子目录)和 运行 CMake。当前目录用作目标路径,而作为参数提供的路径用于查找源树。

cd <glfw-root-dir>

cmake .

要进行树外构建,请在源树之外创建一个目录,进入该目录,然后 运行CMake 使用到源树根目录的(相对或绝对)路径作为参数。

mkdir glfw-build

cd glfw-build

cmake <glfw-root-dir>