我编译并执行了一个从教程中复制的简单 OpenGL + GLEW + GLFW 程序。我在 Win 7 x64 机器上使用了 C++ 和 CodeBlocks 13.12。
仅当 exe 所在的 bin/Debug 文件夹中存在 glfw3.dll 文件时,程序才会执行。否则会报错:程序无法执行,因为在系统中找不到glfw.dll。我使用了默认的 CodeBlocks 设置。
我如何构建程序,以便在包含 exe 文件的文件夹中不需要 glfw3.dll,而是将其内置到程序中?
最佳答案
The static version of the GLFW library is named glfw3. When using this version, it is also necessary to link with some libraries that GLFW uses.
When linking a program under Windows that uses the static version of GLFW, you must link with opengl32. If you are using GLU, you must also link with glu32.
关于c++ - 如何构建 OpenGL + GLEW + GLFW 程序,以便在带有 exe 的文件夹中不需要 glfw3.dll?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22846707/