2

我正在努力使用 Code::Blocks。我正在使用带有 SDL 的 OpenGL。根据我所读到的内容,根据我的错误进行链接时遇到问题。(见下文)这是我在 CB 中的链接设置方式

在此处输入图像描述

错误

-------------- Build: Debug in ColdFusion ---------------

Linking executable: bin\Debug\ColdFusion.exe
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_1_2]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_1_3]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_1_4]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_1_5]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_2_0]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_2_1]+0x4): more undefined references to `_imp__wglGetProcAddress@4' follow
lib\glew32s.lib(./static/release/glew.obj):(.text[_glewGetExtension@4]+0xa): undefined reference to `_imp__glGetString@4'
lib\glew32s.lib(./static/release/glew.obj):(.text[_glewContextInit@0]+0x4): undefined  reference to `_imp__glGetString@4'
lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_3DL_stereo_control]+0x7): undefined reference to `_imp__wglGetProcAddress@4'
lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_AMD_gpu_association]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_ARB_buffer_region]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_ARB_create_context]+0x7): undefined reference to `_imp__wglGetProcAddress@4'
lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_ARB_extensions_string]+0x7): undefined reference to `_imp__wglGetProcAddress@4'
lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_ARB_make_current_read]+0x4): more undefined references to `_imp__wglGetProcAddress@4' follow
lib\glew32s.lib(./static/release/glew.obj):(.text[_wglewGetExtension@4]+0x21): undefined reference to `_imp__wglGetCurrentDC@0'
lib\glew32s.lib(./static/release/glew.obj):(.text[_wglewContextInit@0]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
lib\glew32s.lib(./static/release/glew.obj):(.text[_wglewContextInit@0]+0x3e): undefined reference to `_imp__wglGetCurrentDC@0'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 5 seconds)
15 errors, 1 warnings
4

1 回答 1

3

虽然我不知道 Code::Blocks 如何处理库及其顺序,但我知道顺序很重要。您需要将依赖于某些东西的库放在它所依赖的库之前。

因此,如果其中一个 SDL 库依赖于 glew 库中的函数,则 glew 库应该在列表中的 SDL 库之后。

于 2012-08-03T05:41:33.673 回答