0

I've been attempting to install glew and freeglut to use with Visual Studio 2010. I followed this guide and have backtracked a few times to make sure I followed it correctly but I still get the following errors when I try and compile the example code at the end:

Error 1 error LNK2019: unresolved external symbol _imp_glutMainLoop@0 referenced in function _main c:\Users\Esteban\documents\visual studio 2010\Projects\Chapter 1 Project\Chapter 1 Project\main.obj Chapter 1 Project

Error 2 error LNK2019: unresolved external symbol _imp_glutDisplayFunc@4 referenced in function _InitWindow c:\Users\Esteban\documents\visual studio 2010\Projects\Chapter 1 Project\Chapter 1 Project\main.obj Chapter 1 Project

Error 3 error LNK2019: unresolved external symbol _imp_glutReshapeFunc@4 referenced in function _InitWindow c:\Users\Esteban\documents\visual studio 2010\Projects\Chapter 1 Project\Chapter 1 Project\main.obj Chapter 1 Project

Error 4 error LNK2019: unresolved external symbol _imp_glutInitDisplayMode@4 referenced in function _InitWindow c:\Users\Esteban\documents\visual studio 2010\Projects\Chapter 1 Project\Chapter 1 Project\main.obj Chapter 1 Project

and more just like those. I don't know if its a problem but originally I accidentally grabbed the 64bit version. I realized my mistake and overwrote the files with the 32bit versions, then cleaned and attempted the build again with the same result.

  • Did you actually complete step 6 of your guide? That is, are you actually linking against the libraries? Your errors suggest that you aren't. – Bart May 18 '12 at 09:25

3 Answers3

1

Are you sure that you have done "Step 6: Project Settings (Linker)" in linked guide correctly? It seems that the linker is unable to find symbols that are defined in those libraries (glew and glut32.lib). Also make sure that the Visual Studio knows where to find those libraries (Project->Properties->Configuration properties->VC++ Directories->Library Directories).

runnydead
  • 618
  • 1
  • 7
  • 17
0

All the unresolved external symbols should be found in freeglut.lib. Are you sure that you are properly linking to this library?

Instead of trying to accomplish this in the you could just insert the following line of code in one of your header files:

#pragma comment(lib, "freeglut.lib")
fintelia
  • 1,201
  • 6
  • 17
0

I had this problem too. It turns out I was using the express version of visual studios, so I had to download microsoft sdk to get 64bit openGL libraries. Basically, I found this guide more helpful: http://www.cs.uregina.ca/Links/class-info/315/WWW/Lab1/GLUT/windows.html

Trisha
  • 141
  • 1
  • 2
  • 10