Ubuntu13.04 configure GLUT in Codeblocks

Source: Internet
Author: User
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

Related Article

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.