gpt4 book ai didi

opengl - GLUE 和 CodeBlocks 的链接器问题

转载 作者:行者123 更新时间:2023-12-04 05:37:12 25 4
gpt4 key购买 nike

我正在尝试使用 Code::Blocks。我正在使用带有 SDL 的 OpenGL。从我读过的内容来看,根据我的错误,我在链接时遇到了问题。(见下文)这是我在 CB 中的链接是如何设置的

enter image description here

错误

-------------- 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

最佳答案

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

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

关于opengl - GLUE 和 CodeBlocks 的链接器问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11788455/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com