Code::Blocks provides project templates for both GLUT and FLTK, but no for GLUT + FLTK. Here is a procedure to build a simple GLUT + FLTK program in Code::Blocks.
1. Build up a new project for GLUT by using the Code::Blocks' template.
2. Add search directories setting to the include and library directories of FLTK.
3. Modify #include <GL/glut.h> in main.cpp to #include<FL/glut.H>
4. Modify the Linker settings as follows
1) Add other linker options: -mwindows
2) Link libraries as: fltk_images, fltk_gl, fltk, fltk_png, fltk_z, fltk_jpeg, glu32, opengl32, ole32, uuid, comctl32. Pay attention to that the sequential order of those libraries is important.
The project would be rebuilt successfully. You can then add FLTK functions as you like.
How to install GLUT for mingw
There are some binary distribution of glut in windows available, such as here. But it is not sure if they are available for your system, the version of your gcc compiler on your mingw32 or mingw64 etc. On the other hand, it is not easy to compile its sourcecode in mingw. However, freeglut provides cmake support for cross platform compiling. It is therefore suggested that freeglut, which provides binary distribution also, be adopted.
1. Compile freeglut by using cmake.
2. Keeping the include, library and dll file of freeglut available and compile like:
g++ -Os -Wall test.cc -o test -mwindows -lfreeglut -lopengl32 -lglu32
That's all.
1. Compile freeglut by using cmake.
2. Keeping the include, library and dll file of freeglut available and compile like:
g++ -Os -Wall test.cc -o test -mwindows -lfreeglut -lopengl32 -lglu32
That's all.
订阅:
博文 (Atom)
VS Code下cmake, c++编译,调试环境的构成步骤
1 下载必须extension 按[Ctrl+Shift+X]打开extension窗口,选择安装"C/C++", "CMake", "CMake Tools" 2 在VSCode下打开作业目录 ...
-
假设时间步i中的所有物理量X i 已知, 如果时间步i+1中的所有物理量X i+1 可以表为X i 的显函数 (1) X i+1 = F(X i ) (注;本文以下标i,i+1等表示时间步) 则该物理量X可以显式计算。而如果 (2) ...
-
学过连续体力学(包括固体力学,流体力学等)都知道应力张量是对称的(下面将说明它是有条件的)。 对于初学者, 这似乎有些难于理解, 如 http://forum.simwe.com/forum.php?mod=viewthread&tid=503234&hig...
-
话说黄帝蚩尤大战于涿鹿, 其时浓雾弥漫, 不知东西. 黄帝造指南車辨识道路...... Fig.1 Parralel transport of a vector along a great circle of the sphere 现在考虑A部落的士兵在指南車的...