How do you install GLUT and OpenGL in Visual Studio 2012?

前端 未结 11 2075
悲哀的现实
悲哀的现实 2020-11-30 20:43

I just installed Visual Studio 2012 today, and I was wondering how can you install GLUT and OpenGL on the platform?

11条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-30 20:58

    This is GLUT installation instruction. Not free glut

    First download this 118 KB GLUT package from Here

    Extract the downloaded ZIP file and make sure you find the following

    glut.h

    glut32.lib

    glut32.dll

    If you have a 32 bits operating system, place glut32.dll to C:\Windows\System32\, if your operating system is 64 bits, place it to 'C:\Windows\SysWOW64\' (to your system directory)

    Place glut.h C:\Program Files\Microsoft Visual Studio 12\VC\include\GL\ (NOTE: 12 here refers to your VS version it may be 8 or 10)

    If you do not find VC and following directories.. go on create it.

    Place glut32.lib to C:\Program Files\Microsoft Visual Studio 12\VC\lib\

    Now, open visual Studio and

    1. Under Visual C++, select Empty Project(or your already existing project)
    2. Go to Project -> Properties. Select 'All Configuration' from Configuration dropdown menu on top left corner
    3. Select Linker -> Input
    4. Now right click on "Additional Dependence" found on Right panel and click Edit

    now type

    opengl32.lib

    glu32.lib

    glut32.lib

    (NOTE: Each .lib in new line)

    That's it... You have successfully installed OpenGL.. Go on and run your program.

    Same installation instructions aplies to freeglut files with the header files in the GL folder, lib in the lib folder, and dll in the System32 folder.

提交回复
热议问题