Establish the glut programming environment under viauslc ++ 08, dev-c ++, and Ubuntu

Source: Internet
Author: User
1. visualc ++ 2008 I installed visualc ++ 2008 (9.0) expressionedition. first download the downloaded package from http://www.opengl.org/resources/libraries/glu/gludlls37beta.zip and download it. Then, you will get 5 files (2. put h in c: \ ProgramFi

1. visual c + + 2008

I installed visual c ++ 2008 (9.0) expression edition.

First download the glut package from the http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip

(1) Unpack the downloaded package and obtain 5 files.

(2) Place the glut. h In the c: \ Program Files \ Microsoft SDKs \ Windows \ v6.0a \ Include \ gl folder.

(3) Place the extracted glu32.lib in the c: \ Program Files \ Microsoft SDKs \ Windows \ v6.0a \ Lib folder.

(4) Place the extracted glut. dll and glu32.dll In the system32 folder under the operating system directory.

Run visual c ++ 2008, file-> new project to create an empty win32 console appliction. Right-click solution Explorer on the right and choose Source Files from the shortcut menu, select add-> new item ..., select C ++ File (. cpp)

Enter the following code in the new file to test

# Include
# Include
Int main (int argc, char * argv [])
{
Gluinit (& argc, argv );
Glable (GL_LIGHTING );
Return 0;
}

Compilation is okay.

(Note that visual c ++ 2008 and 2005 are quite different. Their gl and Lib folders are not included in the installation folder Microsoft visual studio 2008, in the Microsoft SDKs folder in the same directory as Microsoft visual studio 9.0, for visual studio 2005 .... VC \ PlatformSDK \ include and... in VC \ PlatformSDK \ Lib, for vc6.0 in c: \ Program Files \ Microsoft visual studio \ VC98)

2. dev-c ++

(1) install http://staff.bath.ac.uk/abscjkw/ComputerPrograms/DevCpp/Dev-Cpp.zip

(2) download the glut package from the website http://www.nigels.com/glt/devpak/and double-click to install the package. He will install necessary libraries and header files.

If the webpage cannot be opened, run Dev c ++. Click Tools> Check for Updates/Packages and Select devpacks.org community devpacks in the Select devpack server box. Then, click check for updates, after checking, find opengl glut from the update package list, download and install it.

(Note that if you want to use the header file that includes glut, it should be # include instead of # include)

3. Ubuntu

This is simple. Just search for glut installation from the source.

However, you need to add the option-lglut during g ++ compilation. Otherwise, he will complain that the glut function does not exist.

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.