Windows 7 64 ビット ラップトップ (HP Pavilion g6) で Visual Studio 2010 Professional を実行しています。
非公式 OpenGL SDK: http://glsdk.sourceforge.net/docs/html/index.html
非公式の OpenGL SDK、GLew、および GLee はすべて最新であり、必要に応じてドライバー、ライブラリ、およびヘッダーが一致しています
設定:
Preprocessor either over the entire project OR over the main.c file: GLEW_STATIC
Additional Include Directories:
C:/glsdk_0.4.2/glload/include;C:/glsdk_0.4.2/glimg/include;C:/glsdk_0.4.2/glutil/include;C:/glsdk_0.4.2/glmesh/include;C:/glsdk_0.4.2/glm;C:/glsdk_0.4.2/glfw/include;C:/glsdk_0.4.2/freeglut/include;
Additional Library Directories:
C:/glsdk_0.4.2/glload/lib;C:/glsdk_0.4.2/glimg/lib;C:/glsdk_0.4.2/glutil/lib;C:/glsdk_0.4.2/glmesh/lib;C:/glsdk_0.4.2/glfw/library;C:/glsdk_0.4.2/freeglut/lib;
Also tried adding C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib/glew32s.lib (or glew32, glew32mx & glew32mxs);C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib/OpenGL32.lib; in Linker -> Input -> Additional Dependancies
Path Inputs (Changed through Environment Variables. Excluding irrelevant entries):
C:\glsdk_0.4.2\glutil\lib;C:\glsdk_0.4.2\freeglut\lib;C:\glsdk_0.4.2\glfw\library;C:\glsdk_0.4.2\glload\lib;C:\glsdk_0.4.2\glimg\lib;
GLew & GLee lib files are located in:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib
Also tried with them located at:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib
GLew & GLee header files are located in:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\GL
Also tried with them located at:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\GL
「OpenGL Distilled」からコピーされたコード (ヘッダー以外)、ISBN10 - 0-321-33679-8:
#include <stdio.h>
#include <math.h>
// Uncomment for GLee ( Also comment out glutInit(&argc, argv); )
//#include <GL\GLee.h>
// Uncomment for GLew
/*#include <GL\glew.h>
#include <GL\wglew.h>
#include <GL\glut.h>
#include <GL\glext.h> */
// Uncomment for all headers in the "Unofficial OpenGL SDK"
/*#include <glload\gl_all.h>
#include <GL\glut.h>
#include <glload\gll.h>
#include <glimg\glimg.h>
#include <glutil\glutil.h>
#include <glmesh\glmesh.h>
#include <GL\glfw.h>
#define FREEGLUT_STATIC
#define _LIB
#define FREEGLUT_LIB_PRAGMAS 0
#include <GL\freeglut.h> */
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
// Obtain a buffer identifier from OpenGL
GLuint bufferID = 0;
glGenBuffers( 1, &bufferID );
// Bind the buffer object, OpenGL initially creates it empty.
glBindBuffer( GL_ARRAY_BUFFER, bufferID );
// Define three vertices to draw a right angle triangle.
const GLfloat vertices[] = [
0.f, 0.f, 0.f,
1.f, 0.f, 0.f,
0.f, 1.f, 0.f };
// Tell OpenGL to copy data from the 'vertices' pointer into
// the buffer object
glBufferData(GL_ARRAY_BUFFER, 3*3*sizeof(GLfloat), vertices, GL_STATIC_DRAW );
return 0;
}
エラー:
With GLee:
1>gl_crap3.obj : error LNK2001: unresolved external symbol _GLeeFuncPtr_glBufferData
1>gl_crap3.obj : error LNK2001: unresolved external symbol _GLeeFuncPtr_glBindBuffer
1>gl_crap3.obj : error LNK2001: unresolved external symbol _GLeeFuncPtr_glGenBuffers
With the Unofficial OpenGL SDK:
1>gl_crap3.obj : error LNK2001: unresolved external symbol ___gleBufferData
1>gl_crap3.obj : error LNK2001: unresolved external symbol ___gleBindBuffer
1>gl_crap3.obj : error LNK2001: unresolved external symbol ___gleGenBuffers
With GLew:
1>gl_crap3.obj : error LNK2001: unresolved external symbol ___glewBufferData
1>gl_crap3.obj : error LNK2001: unresolved external symbol ___glewBindBuffer
1>gl_crap3.obj : error LNK2001: unresolved external symbol ___glewGenBuffers