本文介绍了连接在C GLEW的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法正确链接到GLEW。
I can't link properly to glew.
我已经做了:
#define GLEW_STATIC
#include "glew/glew.h"
#pragma comment(lib, "glew/glew32s.lib")
不过,我仍然得到错误:
However, I still get the error:
LNK2019:在函数引用解析的外部符号__glewGenBuffersARB初始化
LNK2019: unresolved external symbol __glewGenBuffersARB referenced in function initialize
推荐答案
保存自己的很麻烦的,只是把 glew.c
文件到您的项目。我从来没有链接到一个GLEW库外部打扰。一旦你有,在那里, GLEW_STATIC
宏将正常工作。它只有一个文件,(如果这对你很重要),它会很好地进行跨平台(而不是重建几个特定OS-库)。
Save yourself a lot of trouble and just put the glew.c
file into your project. I never bother with linking to a glew library externally. Once you have that in there, the GLEW_STATIC
macro will work. It's only one file, and (if this matters to you) it will carry nicely across platforms (rather than having to rebuild several OS-specific libs).
这篇关于连接在C GLEW的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!