The Ubuntu version is 13.04Ubuntu12.04. For the installation Code: Block, see Ubuntu.
The Ubuntu version is 13.04
Ubuntu 12.04 installation Code: Block See http://www.linuxidc.com/Linux/2012-10/73116.htm
Code: Blocks: Click here
Code: Blocks: Click here
Article 1 Basic compilation environment Configuration
1. Create a basic compilation environment
Sudo apt-getinstall build-essential
2. Install OpenGL Library
Sudo apt-getinstall libgl1-mesa-dev
3. Install OpenGL Utilities
Sudo apt-getinstall libglu1-mesa-dev
4. Install OpenGL Utility ToolKit
Sudo apt-get install libglut-dev
Problem 1:
! An error occurred while running this command. The system prompts that the software package cannot be found!
To install the libglut3-dev, the error is the same.
Solution:
Install the freeglut3-dev instead of libglut-dev
Sudo apt-get installfreeglut3-dev
5. Compile the source code example. c.
6. Compile and run
Gcc example. c-oexample. out-lGL-lGLU-lglut
./Example. out
You can see the teapot here.
Article 2 Use glut in Codeblocks
1. Install codeblocks and create a new GLUT Project
Problem 2:
! When selecting the GLUT location, errors are always prompted. In fact, lib and. H files are already in/usr!
Solution:
Do not use the GLUT Project that comes with Codeblocks
Create a project manually, including the Linked Library file. The procedure is as follows:
2. Create a Console Application project
3. Contains link libraries related to OpenGL/Glut
Project à Build Options à Linkersettings
Add file: libGL. so libglut. so libGLU. sO
For example
4. Compile, compile, and run the source code.
The running effect is as follows,
Build a Glut Development Environment http://www.linuxidc.com/Linux/2010-06/26457.htm in Ubuntu
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2