Construction of OpenGL environment in Ubuntu12.04LTS

Source: Internet
Author: User
1. Install IDE: Use the codeblocks command below: sudoapt-getinstallcodeblocks2. Configure openGL under Ubuntu: download and install the library sudoapt-getinstallmesa-common-devlibgl1-mesa-devlibglu1-mesa-devsudoapt-getinstallfree required by openGL

1. Install IDE: codeblocks is used

The command is as follows:

Sudo apt-get install codeblocks

2. Configure openGL in Ubuntu: download and install the library required by openGL

Sudo apt-get install mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev

Sudo apt-get install freeglut3-dev freeglut3

Sudo apt-get install build-essential gdb subversion

Sudo apt-get install automake autoconf libtool

Sudo apt-get install libgtk2.0-dev libxmu-dev libxxf86vm-dev

3. Configure codeblocksIDE: In Settings> compilerand debugger settings> link settings, add:

/Usr/lib/libGL. so

/Usr/lib/libGLU. so

/Usr/lib/libglut. so

4. Development

When creating a GLUT project for the first time, you may encounter a question about the location of the GLUT. You can set it to/usr:

5. Create a New GLUT project. An error is reported during compilation:

G ++ error:/usr/lib/libGL. so: the file or directory does not exist.

G ++ error:/usr/lib/libGLU. so: the file or directory does not exist.

Find these two files in the file system, and mine is in the/usr/lib/i386-linux-gnu/directory. Enter the following command on the terminal:

$ Sudo cp/usr/lib/i386-linux-gnu/libGL. so/usr/lib/libGL. so

$ Sudo cp/usr/lib/i386-linux-gnu/libGLU. so/usr/lib/libGLU. so

After modification, You can compile the program to view the running result.

Attachment: view the default software installation location in Ubuntu

Method 1: Enter the dpkg-L software package name in the command line;

Method 2: Find the package of your installation program in/var/cache/apt/archives, and then use "gdebi-gtk + package name" to view the specific installation location.

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.