That is not a Code::Blocks problem. It just uses your files and compiler and shows the compiler messages.
Concerning glut, I would recommend using freeglut (http://freeglut.sourceforge.net/). WINAPI should be defined, if windows.h is included; freeglut does it the in the following way:#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
/* #pragma may not be supported by some compilers.
* Discussion by FreeGLUT developers suggests that
* Visual C++ specific code involving pragmas may
* need to move to a separate header. 24th Dec 2003
*/
# define WIN32_LEAN_AND_MEAN
# define NO_MIN_MAX
# include <windows.h>
Probably your version of glut doesn't check for MinGW.
mingw32-g++.exe -LZ:\mingw\lib -LZ:\MinGW\lib -o bin\Debug\Simple.exe obj\Debug\Simple.o -lopengl32 -lglu32 -lgdi32 -lglut32.lib -llglut32.lib
Z:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lglut32.lib
You *need* the GLUT library and headers if you want to compile 3GLUT applications. They are *not* provided with MinGW. Try google and/or download the GLUT DevPack. Then add the path of the GLUT headers to the compiler options and the path to the GLUT libs to the linker options.
The very same applies to freeGLUT. IMHO there is a pre-compiled DevPack available, too. Nothing required to compile yourself here (except your very application), just make your project aware of where to find (free)GLUT stuff.
With regards, Morten.
ok, here's what I did.
1) downloaded glut, put glut32.lib in the lib folder of mingw, put glut.h in include/gl of mingw.
2)Created a new project with the opengl template.
3)went to the build options (the universal, not release/debug specific) as show in attachment 1
4) added glut32 to the linker
received the following errors
obj\Release\Simple.o:Simple.cpp:(.text+0x17):: undefined reference to `__glutCreateMenuWithExit@8'
obj\Release\Simple.o:Simple.cpp:(.text+0x8f):: undefined reference to `__glutInitWithExit@12'
obj\Release\Simple.o:Simple.cpp:(.text+0xe6):: undefined reference to `__glutCreateWindowWithExit@8'
:: === Build finished: 3 errors, 0 warnings ===
5) I changed the linker lib to glut32.lib but received
ld.exe:: cannot find -lglut32.lib
:: === Build finished: 1 errors, 0 warnings ===
[attachment deleted by admin]