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.