Hi all, I want to make a simple window with GLUT, this is what I get when I compile it:
Project : OpenGL Application
Compiler : GNU GCC Compiler (called directly)
Directory : C:\C\Projects\GLUT_Window--------------------------------------------------------------------------------
Switching to target: default
Linking executable: C:\C\Projects\GLUT_Window\GLUT.exe
.objs\main.o:main.cpp:(.text+0x48): undefined reference to `glutInit'
.objs\main.o:main.cpp:(.text+0x5c): undefined reference to `glutInitWindowPosition'
.objs\main.o:main.cpp:(.text+0x70): undefined reference to `glutInitWindowSize'
.objs\main.o:main.cpp:(.text+0x7c): undefined reference to `glutCreateWindow'
.objs\main.o:main.cpp:(.text+0x88): undefined reference to `glutDisplayFunc'
.objs\main.o:main.cpp:(.text+0x9f): undefined reference to `glutMainLoop'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
The glut operations dont work for a weird reason. I Included the latest glut library file for the latest glut .dll file, and added the latest glut .h file. What could else be wrong?
Code:
#define GLUT_DISABLE_ATEXIT_HACK
#include <GL/add/glut.h>
bool init()
{
return true;
}
void display()
{
}
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitWindowPosition(50, 50);
glutInitWindowSize(500, 500);
glutCreateWindow("01 - GLUT Window");
glutDisplayFunc(display);
if (!init())
{
return 1;
}
glutMainLoop();
return 0;
}
Noone of the functions are working :S.
The linker files are:
-lopengl32
-lglu32
-lglut32 (or -lglut or -glut)
Any help will be appreciated