Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL config in Visual Studio 2010

i would like to use OpenGl in Visual Studio 2010. Following Problem: "error LNK1104: Data "GIU32.lib OpenGL32.lib freeglut.lib glut32.lib" could not be oppend"

I read many Tutorials but they don´t help me :-(. The lib data sets are in "C:\Program Files(x86)\Microsoft SDKs\Windows\v7.0a\lib". The header data sets are in "C:\Program Files(x86)\Microsoft SDKs\Windows\v7.0a\Include\gl" The dll data sets are in "C:\Windows\SysWOW64"

I Use Windows 7 Professional 64Bit.

I put "GIU32.lib OpenGL32.lib freeglut.lib glut32.lib" on Project > Properties > Linker > Input.

like image 973
Fabian Schaub Avatar asked Nov 06 '22 08:11

Fabian Schaub


2 Answers

This is what you need to do.

  1. Obtain GLUT for Windows (OpenGL Utility Toolkit) from Nate Robins’ web page. I put it on my C drive. The current documentation for GLUT tells you to go into the glut project folder and build the glut.dsw Visual Studio project. This is a little misleading since there is no glut.dsw file and all the dll, lib etc files you need are already there! So don’t worry about doing this, just download it.

  2. Create a Visual Studio Project such as a new Console Application. For Windows XP: paste the glut32.dll file into: C:\Windows\System32. For Windows 7: place the glut32.dll inside the C:\Windows\SysWOW64 folder instead.

  3. In the Project properties, select C/C++ -> General -> Additional Include Directories and add the location of the glut.h header file. This might be C:\glut-3.7.6-bin\

  4. In the Project properties, select Linker -> General -> Additional Library Directories and add the location of the glut libraries eg C:\glut-3.7.6-bin\

  5. In the Project properties, select Linker -> Input -> Additional Dependencies and add “glut32.lib”.

It should then compile. For a more detailed explanation, plus advice for installing the latest Windows Drivers from the Intel site, see this blog post.

like image 77
AndyUK Avatar answered Nov 09 '22 15:11

AndyUK


Your error message lists all missing files in the same error. That means you didn't set your dependencies correctly, because the linker searched for the file "GIU32.lib OpenGL32.lib freeglut.lib glut32.lib", which doesn't exist, of course.

The file names have to be separated by ";" in the Additional Dependencies section (under Linker > Input). Or, if you use the edit menu by choosing it from the drop-down selection, each dependency has to be in a new line.

So you have to write "GIU32.lib;OpenGL32.lib;freeglut.lib;glut32.lib".

like image 40
Vincent K Avatar answered Nov 09 '22 14:11

Vincent K