Configuring OpenGL in Codeblocks is slightly different than configuring OpenGL in VC, VS, and requires slightly different library files. This article takes CB13 as an example. (Old and new versions are common, but it is best to use mingw tools, GCC/GDB, etc., other compiled kernels are not tested)
First, download the library files (downloaded at the bottom of the article, uploaded to the 100 cloud, if the link fails, you can reply or email me to continue the upload), including Glut. h, Glut32.dll, LibGlut32.a.
And then you set up the project, and notice that you set up the project for GLUT
The next step, when I get here,
Path selection:
Different installation paths and different systems may vary, but choose the MinGW folder under the CodeBlocks installation path.
Then proceed, when it is time to select the Project name and save the path, the path must not be in Chinese, and it is better not to be on the desktop (sometimes can not compile, CB common fault). Once established, you can open the Main.cpp sample program in the Projects TAB of the Management sidebar on the left.
Not yet, select the top column Project->; Build Options, click the Debug TAB on the left, the Linker Setting TAB on the right, and click Add below.
File select this:
* Note: Do not mix libglu32.a with libglut32.a.
Open, “Keep Relative Path”, “No”, OK all the way, then F9 can run the program.
Also, if you don’t need ifdef in the sample program, you can simply do this:
If you want to use this library in the future, just include GL/ Glut.h.
The result should be this:
The main difference with VC and VS is that the library file is libglut32.a instead of other.lib files, so all we need to do is convert glut32.lib to libglut32.a. There is a program on SourceForge that can do this, but I can’t find it now, so just download it.
Relevant documents please go to my personal page: http://alanzjl.sinaapp.com/2015/02/opengl_in_codeblocks/
Or: http://download.csdn.net/detail/alanzjl/8463847 to download
First, download the library files (downloaded at the bottom of the article, uploaded to the 100 cloud, if the link fails, you can reply or email me to continue the upload), including Glut. h, Glut32.dll, LibGlut32.a.
- Put the glut32. h file under the MinGw\include\GL directory and the glut32. DLL file under the C:\Windows\ system32 directory (for 64-bit operating systems, put the file under the C:\Windows\SysWOW64 directory) and the libglut32.a file under the MinGw\lib\ directory
And then you set up the project, and notice that you set up the project for GLUT
The next step, when I get here,
Path selection:
Different installation paths and different systems may vary, but choose the MinGW folder under the CodeBlocks installation path.
Then proceed, when it is time to select the Project name and save the path, the path must not be in Chinese, and it is better not to be on the desktop (sometimes can not compile, CB common fault). Once established, you can open the Main.cpp sample program in the Projects TAB of the Management sidebar on the left.
Not yet, select the top column Project->; Build Options, click the Debug TAB on the left, the Linker Setting TAB on the right, and click Add below.
File select this:
* Note: Do not mix libglu32.a with libglut32.a.
Open, “Keep Relative Path”, “No”, OK all the way, then F9 can run the program.
Also, if you don’t need ifdef in the sample program, you can simply do this:
If you want to use this library in the future, just include GL/ Glut.h.
The result should be this:
The main difference with VC and VS is that the library file is libglut32.a instead of other.lib files, so all we need to do is convert glut32.lib to libglut32.a. There is a program on SourceForge that can do this, but I can’t find it now, so just download it.
Relevant documents please go to my personal page: http://alanzjl.sinaapp.com/2015/02/opengl_in_codeblocks/
Or: http://download.csdn.net/detail/alanzjl/8463847 to download
Read More:
- Configuring OpenGL environment with code blocks16.0 in Windows 10
- The solution of configuring OpenGL in vs2017
- Configuring OpenGL in Chinese version of VS2010 and problem solving
- Configuring OpenGL in VS
- Configuring OpenGL with win 10 + CodeBlocks
- A series of problems in configuring OpenGL development environment in vs2015
- CodeBlocks configuring OpenGL
- Configuring OpenGL in Visual Studio 2015
- The simplest course of configuring OpenGL in vs2015
- Configuring OpenGL in Visual Studio
- Problems in configuring OpenGL
- Code:: blocks prompt nullptr’s was not declared in this scope
- Configuring OpenGL development environment in win10 + vs2015 (including the method of installing 32-bit and 64 bit libraries)
- Vc2010 configuring OpenGL environment
- CodeBlocks configuring OpenGL environment
- Configuring OpenGL + glew in windows10 + Visual Studio 2017
- Write about the problems and solutions when configuring OpenGL in vs2015
- Problems encountered in configuring OpenGL development environment in vs2015
- Using cbmakegen to export makefile of code:: blocks
- Configuring glfw library and glad Library in opengl-vs2015