我正在开发一个OpenGL程序来测试着色器,并尝试编译它们。然而,调用glCreateShader()(以及其他着色器调用,如glDeleteShader)会出现以下错误:
(此错误来自glCreateShader())
我正在使用Visual Studio 2012和Windows 7。拥有最新的NVIDIA显卡,包括最新的驱动程序,所以不可能是我的OpenGL版本的问题。
我正在使用glTools头文件来使用OpenGL Superbible第四版中所有的帮助函数。不确定使用这些文件是否存在错误?
为了帮助解决问题,我会发布我的包含文件。
好的,问题已经得到解决,感谢答案:
(此错误来自glCreateShader())
Error 3 error LNK2001: unresolved external symbol _pglCreateShader
我正在使用Visual Studio 2012和Windows 7。拥有最新的NVIDIA显卡,包括最新的驱动程序,所以不可能是我的OpenGL版本的问题。
我正在使用glTools头文件来使用OpenGL Superbible第四版中所有的帮助函数。不确定使用这些文件是否存在错误?
为了帮助解决问题,我会发布我的包含文件。
#pragma once
#include <Windows.h>
// Basic C++ includes
#include <stdio.h>
#include <tchar.h>
#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <vector>
using namespace std;
// OpenGL specific and GUI includes
#include "shared/gltools.h"
#include "shared/math3d.h"
#include <SOIL.h>
以及链接器选项:
soil.lib;opengl32.lib;gltools.lib;
好的,问题已经得到解决,感谢答案:
我编辑了我的glTools.h文件,将'glee.h'替换为'gl/glew.h',在链接器中添加了';glew32.lib'选项,并在进入主循环之前添加了glewInit()。 我还将GLEW libs,dlls和includes添加到了适当的文件夹中,所有函数都像应该的那样工作了! :)