简体   繁体   English

链接到 glew32s.lib 的未解析外部符号

[英]Unresolved external symbols linking to glew32s.lib

So this isn't the first time I have run into this problem, but the solutions that worked in the past don't seem to be working.所以这不是我第一次遇到这个问题,但过去有效的解决方案似乎并不奏效。 I am currently receiving the following errors:我目前收到以下错误:

Error   LNK1120 6 unresolved externals
Error   LNK2019 unresolved external symbol __imp__glGetString@4 referenced in function _glewContextInit@0
Error   LNK2019 unresolved external symbol __imp__wglGetCurrentDC@0 referenced in function _wglewGetExtension@4
Error   LNK2019 unresolved external symbol __imp__wglGetProcAddress@4 referenced in function __glewInit_GL_3DFX_tbuffer
Error   LNK2019 unresolved external symbol __imp__glClear@4 referenced in function "public: void __thiscall vortex::graphics::Window::clear(void)const " (?clear@Window@graphics@vortex@@QBEXXZ)
Error   LNK2019 unresolved external symbol __imp__glEnable@4 referenced in function "private: bool __thiscall vortex::graphics::Window::init(void)" (?init@Window@graphics@vortex@@AAE_NXZ)
Error   LNK2019 unresolved external symbol __imp__glViewport@16 referenced in function "void __cdecl vortex::graphics::windowResize(struct GLFWwindow *,int,int)" (?windowResize@graphics@vortex@@YAXPAUGLFWwindow@@HH@Z)

to give you a rundown of what I have tried, I have checked and rechecked the linking paths to the libraries, I have put the GLEW_STATIC preprocessor definition in the necessary section, I have redownloaded the libraries multiple times to make sure I was linking a Win32 library to the Win32 application, and I have no idea what to do now.为了向您简要介绍我的尝试,我已经检查并重新检查了库的链接路径,我已将 GLEW_STATIC 预处理器定义放在必要的部分中,我已多次重新下载库以确保我正在链接 Win32库到 Win32 应用程序,我不知道现在该怎么做。 It was working fine for awhile, and the above solutions would always fix this sort of error, but not this time.它运行良好有一段时间,上述解决方案总是可以修复此类错误,但这次不行。 The sooner I can get a response the better, as this is a project that I wanna get more work done on soon.我越早得到回应越好,因为这是一个我想尽快完成更多工作的项目。 Thank you for any help you can give me.谢谢你能给我的任何帮助。

将OpenGL32.lib和glu32.lib添加到链接器输入中。

将 opengl32.lib 添加到您的链接器输入,并将 GLEW_STATIC 添加到您的 Properties->C/C++->Preprocessor->Preprocessor Definitions

I had a very similar problem myself, and the solution for me was adding the glew32.dll to the folder, as well as adding #pragma comment(lib, "glew32.lib") and linking to it. 我自己有一个非常类似的问题,对我来说,解决方案是将glew32.dll添加到该文件夹​​,以及添加#pragma comment(lib, "glew32.lib")并链接到该文件夹​​。 The glew32.dll will refer to glew32.lib, so if you dont have it, it will give off similar linking errors. glew32.dll将引用glew32.lib,因此,如果您没有它,它将发出类似的链接错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM