If I recall correctly, the make program that ships with DevC++ returns 1 if the make failed. It can fail because the compiler returned an error or the linker failed. It might therefore be more helpful to report some of the other errors you're having because I believe the problem could lie there.
If you're using DevC++, it might be worth looking to see if the example you're trying to compile is using glaux.h, as that's likely to be a sticky point (DevC++ doesn't ship glaux by default).
Build Error 1?
Nope, glaux just created more errors. I guess I'll just have to buy VC++.net because it doesn't work in my VS.netAcademic
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Projects\OpenGL Examples\Chapter01\Simple\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Projects\OpenGL Examples\Chapter01\Simple\Makefile.win" all
g++.exe Simple.o -o "Simple.exe" -L"C:/Dev-Cpp/lib" -mwindows glut32.lib opengl32.lib
g++.exe: opengl32.lib: No such file or directory
make.exe: *** [Simple.exe] Error 1
Execution terminated
oh, I never saw the g++.exe before. where shoudl I get it and put it?
Building Makefile: "C:\Dev-Cpp\Projects\OpenGL Examples\Chapter01\Simple\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Projects\OpenGL Examples\Chapter01\Simple\Makefile.win" all
g++.exe Simple.o -o "Simple.exe" -L"C:/Dev-Cpp/lib" -mwindows glut32.lib opengl32.lib
g++.exe: opengl32.lib: No such file or directory
make.exe: *** [Simple.exe] Error 1
Execution terminated
oh, I never saw the g++.exe before. where shoudl I get it and put it?
Okay, i just realized that I wasn't linking to glut32.lib correctly but I still have a bunch of wrrors now that are more specific. I included and linked all GL related things. So my whole source is
and I'm linked to
OPENGL32.lib
GLU32.lib
glut32.lib
GLAUX.lib
My compile log is:
I know nothing aboyt this g++.exe. Maybe that has something to do with it.
#include <windows.h>#include <gl\gl.h>#include <gl\glu.h>#include <gl\glut.h>#include <gl\glaux.h>#include <gl\glext.h>void Initialize();void MouseHandler(int button, int state, int x, int y);void KeyboardHandler(unsigned char key, int x, int y);void MainMenuHandler(int option);void Animate();void Reshape(int width, int height);void Display();/**************************************************************************** main() Setup GLUT and OpenGL, drop into the event loop*****************************************************************************/int main(int argc, char **argv){ // Setup the basic GLUT stuff glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); // Create the window glutInitWindowSize(1024, 768); glutInitWindowPosition(100, 150); glutCreateWindow("BOGLGP Chapter 1"); Initialize(); // Register the event callback functions glutDisplayFunc(Display); glutReshapeFunc(Reshape); glutMouseFunc(MouseHandler); glutKeyboardFunc(KeyboardHandler); glutIdleFunc(Animate); // At this point, control is relinquished to the GLUT event handler. // Control is returned as events occur, via the callback functions. glutMainLoop(); return 0;} // end main()/**************************************************************************** Initialize() One time setup, including creating menus, creating a light, setting the shading mode and clear color, and loading textures.*****************************************************************************/void Initialize(){ // set up the only meny int mainMenu; mainMenu = glutCreateMenu(MainMenuHandler); glutSetMenu(mainMenu); glutAddMenuEntry("Exit", 0); glutAttachMenu(GLUT_RIGHT_BUTTON); glEnable(GL_DEPTH_TEST);} // end Initialize()/**************************************************************************** MouseHandler() Handle mouse events. For this simple demo, just exit on a left click.*****************************************************************************/void MouseHandler(int button, int state, int x, int y){ switch (button) { case GLUT_LEFT_BUTTON: { exit(0); } break; default: break; } // force a screen redraw glutPostRedisplay();} // end MouseHandler()/**************************************************************************** KeyboardHandler() Keyboard handler. Again, we'll just exit when q is pressed.*****************************************************************************/void KeyboardHandler(unsigned char key, int x, int y){ switch (key) { case 'q': // exit { exit(0); } break; default: { } break; } glutPostRedisplay();} // end KeyboardHandler()/**************************************************************************** MainMenuHandler() Main menu callback.*****************************************************************************/void MainMenuHandler(int option){ switch(option) { case 0: { exit(0); } break; default: break; } glutPostRedisplay();} // end MainMenuHandler()/**************************************************************************** Animate() Rotate the cube by 4 degrees and force a redisplay.*****************************************************************************/void Animate(){ glutPostRedisplay();} // end Animate()/**************************************************************************** Reshape() Reset the viewport for window changes*****************************************************************************/void Reshape(int width, int height){ if (height == 0) return; glViewport(0, 0, (GLsizei) width, (GLsizei) height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(90.0, width/height, 1.0, 100.0); glMatrixMode(GL_MODELVIEW);} // end Reshape/**************************************************************************** Display() Clear and redraw the scene.*****************************************************************************/void Display(){ // set up the camera glLoadIdentity(); gluLookAt(0.0, 1.0, 6.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); // clear the screen glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // draw a triangle glBegin(GL_TRIANGLES); glColor3f(1.0, 0.0, 0.0); glVertex3f(2.0, 2.5, -1.0); glColor3f(0.0, 1.0, 0.0); glVertex3f(-3.5, -2.5, -1.0); glColor3f(0.0, 0.0, 1.0); glVertex3f(2.0, -4.0, 0.0); glEnd(); // draw a polygon glBegin(GL_POLYGON); glColor3f(1.0, 1.0, 1.0); glVertex3f(-1.0, 2.0, 0.0); glColor3f(1.0, 1.0, 0.0); glVertex3f(-3.0, -0.5, 0.0); glColor3f(0.0, 1.0, 1.0); glVertex3f(-1.5, -3.0, 0.0); glColor3f(0.0, 0.0, 0.0); glVertex3f(1.0, -2.0, 0.0); glColor3f(1.0, 0.0, 1.0); glVertex3f(1.0, 1.0, 0.0); glEnd(); // draw everything and swap the display buffer glutSwapBuffers();} // end Display()
and I'm linked to
OPENGL32.lib
GLU32.lib
glut32.lib
GLAUX.lib
My compile log is:
Compiler: Default compilerBuilding Makefile: "C:\Dev-Cpp\Projects\Chapter01\Simple\Makefile.win"Executing make...make.exe -f "C:\Dev-Cpp\Projects\Chapter01\Simple\Makefile.win" allg++.exe -c Simple.cpp -o Simple.o -I"C:/Dev-Cpp/include/c++/3.3.1" -I"C:/Dev-Cpp/include/c++/3.3.1/mingw32" -I"C:/Dev-Cpp/include/c++/3.3.1/backward" -I"C:/Dev-Cpp/lib/gcc-lib/mingw32/3.3.1/include" -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/include" windres.exe -i Simple_private.rc -I rc -o Simple_private.res -O coff g++.exe Simple.o Simple_private.res -o "Simple.exe" -L"C:/Dev-Cpp/lib" -L"C:/Dev-Cpp/lib" -mwindows ../../../lib/OPENGL32.LIB ../../../lib/GLU32.LIB ../../../lib/glut32.lib ../../../lib/GLAUX.LIB Simple.o(.text+0x1c):Simple.cpp: undefined reference to `__glutInitWithExit@12'Simple.o(.text+0x3d):Simple.cpp: undefined reference to `__glutCreateWindowWithExit@8'Simple.o(.text+0x5d):Simple.cpp: undefined reference to `__glutCreateMenuWithExit@8'Simple.o(.text+0xb5):Simple.cpp: undefined reference to `glutInitDisplayMode@4'Simple.o(.text+0xcc):Simple.cpp: undefined reference to `glutInitWindowSize@8'Simple.o(.text+0xe3):Simple.cpp: undefined reference to `glutInitWindowPosition@8'Simple.o(.text+0x106):Simple.cpp: undefined reference to `glutDisplayFunc@4'Simple.o(.text+0x115):Simple.cpp: undefined reference to `glutReshapeFunc@4'Simple.o(.text+0x124):Simple.cpp: undefined reference to `glutMouseFunc@4'Simple.o(.text+0x133):Simple.cpp: undefined reference to `glutKeyboardFunc@4'Simple.o(.text+0x142):Simple.cpp: undefined reference to `glutIdleFunc@4'Simple.o(.text+0x14a):Simple.cpp: undefined reference to `glutMainLoop@0'Simple.o(.text+0x179):Simple.cpp: undefined reference to `glutSetMenu@4'Simple.o(.text+0x190):Simple.cpp: undefined reference to `glutAddMenuEntry@8'Simple.o(.text+0x19f):Simple.cpp: undefined reference to `glutAttachMenu@4'Simple.o(.text+0x1d4):Simple.cpp: undefined reference to `glutPostRedisplay@0'Simple.o(.text+0x1fe):Simple.cpp: undefined reference to `glutPostRedisplay@0'Simple.o(.text+0x220):Simple.cpp: undefined reference to `glutPostRedisplay@0'Simple.o(.text+0x22d):Simple.cpp: undefined reference to `glutPostRedisplay@0'Simple.o(.text+0x58c):Simple.cpp: undefined reference to `glutSwapBuffers@0'make.exe: *** [Simple.exe] Error 1Execution terminated
I know nothing aboyt this g++.exe. Maybe that has something to do with it.
I got IT!!!!!!!!!!!!!!!!! Dev-C++ has it's own versions of the liabraries like glut32.lib would be libglut32.a but it WORKS!!!!!!!!!
Whoa now! Provide some info! I'm having the same problem and can't for the life of me find the solution. How did you do that?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement