GLUT Tutorial-Installation

Source: Internet
Author: User

Reprint: http://www.cnblogs.com/live41/p/3368830.html

GLUT Library-Download channel-csdn.net
http://download.csdn.net/download/jingshuang/272930

What do you need?

To use the Glut Library development program, you can download the latest version of 3.7.6. You can glut the source code, or you can go directly down the Windows binaries (. H/.lib/.dll)

To use the GLUT library to develop C/D + + programs, the following three files are used:

Glut.h-This is the included header file that your program will use. Typically placed in the C:\Program Files\Microsoft Visual Studio 11.0\vc\include\gl\ directory.

Glut32.lib (Windows version)-this file is linked to your program and is guaranteed to be placed in the C:\Program Files\Microsoft Visual Studio 11.0\vc\lib\ directory.

Glut32.dll (Windows version)-can be placed in the same directory as the program's. exe file, or in the C:\Windows\System32 directory (if it is 64-bit Windows, put in the C:\Windows\SysWOW64 directory).

Configuring to Visual Studio 2010

Create a new C + + file with the Win32 console program (WIN32 console application), empty project, new project, and then you can start coding.

When you run the sample code for the next section, you'll find two windows, one for OpenGL, and one for the command Line window. The command-line window can be used to output some key information.

When you're familiar, you'll want to have a Relationship command-line window, which can be done in the following ways:

Project properties, Linker (Linker), subsystem (System), subsystems (SubSystem)

Set the value to WINDOWS (/subsystem:windows)

Project properties, Linker (Linker), command line

Add/entry:maincrtstartup to additional option (Additional options)

You want to tell vs where to find Glut's header files and library files.

Solution Properties-VC + + directory (VC + + Directories), respectively, fill in the path of include and Lib

User note for Legacy vs

VS2003 and 2005 sometimes report this error:

Error C2381: ' exit ': redefinition; __declspec (noreturn) differsc:\opengl\toolkits\includes\gl\glut.h (146): See Declaration of ' exit '

The reason is that # include <GL/glut.h> must be placed behind # include <stdlib.h>.

GLUT Tutorial-Installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.