29
votes

I am new in opengl and i have no idea what this error means. I am using Visual Studio 2012 > C++ > Empty Project. I Follow these steps in other pc thats work for me but i am doing this in my pc i am getting this error.

ERROR

Error 1 error LNK1107: invalid or corrupt file: cannot read at 0x2B0 ?>C:\Users\Uxi\Desktop\Sp16 \Vs\OpenglPrac\OpenglPrac\glew32.dll 1 1 >OpenglPrac

Steps i Follow Is :

  1. Copy the Folder Glew and Glut from My folder to your desktop.
  2. Open Visual Studio , Select New Project
  3. Select Visual C++, Select Empty Project
  4. Write OpenGLProject as the name of your project.
  5. Right click on your project in solution explorer and select add -> add new item.
  6. Select C++ .cpp item , Name it HelloOpenGL.
  7. Right Click on your Project again, select properties
  8. Select all configuration in configuration dropdown list
  9. Go to C/ C++ -> General
  10. Go to Additional Include Directories
  11. Click on the button on right side and select Edit then select glew/include folder
  12. Click on the button on right side and select Edit then select glut/include folder
  13. Press OK
  14. Now Go to Linker - > Input
  15. Go to Additional Dependencies
  16. Click on Edit and Right glew32.lib and freeglut.lib.
  17. Press OK
  18. Now go to General
  19. Go to Additional libraries Directories
  20. Go to the Glew folder and select lib
  21. Go to the freeglut folder and select lib..

ThankYou.

1
Make sure that you have linked against glew32.lib and not against glew32.dll. Normally this error occurs when linking against a dll instead of the lib and the error message also says glew32.dll (which should normally not be part of the linking process at all).BDL
Hi thank you bdl. I mistakenly wrote glew32.dll in link insist of glew32.lib now i compile the project no error occurs but my build is hang in OpenglPrac.vcxproj -> .Uzair
What do you mean by hang? Does it simply stop somewhere during the build? What does the output window show?BDL
yes its freezes in build . no output generates. i know it is tool set problem but its not showing for win-xp option.Uzair

1 Answers

62
votes

The error message suggests, that you have linked against glew32.dll instead of glew32.lib. One always has to link against the lib file and copy the dll to a place where it can be found at runtime.