Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 G++ 将我的项目链接到 glew32、glfw、opengl32、glu32 等,一切都编译得很好 - 但是在链接阶段,除了 glViewport 链接之外的所有内容,我得到了这个错误:
未定义对“_glViewport”的引用。
我觉得这......很奇怪,因为其他一切都很好,我有点不知所措。我期待任何关于尝试和或做什么的建议。
根据我的评论,您需要在编译时链接 OpenGL 库(Linux/cygwin)
g++ -o target source.c -lGL
要链接到 Mac OSX 上的 OpenGL 库,它是
g++ -o target source.c -framework OpenGL