#include<cuda_runtime.h>
#include<cuda_gl_interop.h>
int g_WindowWidth;
int g_WindowHeight;
void render(void);
void createTexturedQuad(void);
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowPosition(0,0);
glutInitWindowSize(800, 600);
glutCreateWindow("Test Window");
glutDisplayFunc(render);
glutMainLoop();
//Initiallize OpenGL extensions
glewInit();
if( !glewIsSupported("GL_VERSION_4_0") )
{
return -1;
}
// viewport
glViewport(0, 0, g_WindowWidth, g_WindowHeight);
// projection
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60.0, (GLfloat)g_WindowWidth / (GLfloat) g_WindowHeight, 0.1, 10.0);
//cudaGLSetGLDevice(gpuGetMaxGflopsDeviceId());
}
void render()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glutSwapBuffers();
}
I get "unresolved external symbols" errors in Visual Studio 2010 where I call glewInit() and glewIsSupported(). I've added the paths to the bin/ and lib/ folders under "Library Directories" in the VC++ Directories tab. I've also added the paths to the include folders for GLEW and freeglut. In addition, I have specified that the following libraries be included: opengl32.lib, glew32.lib, freeglut.lib.
I am not sure what I could be doing to screw this up.






