Another Glut Simple DEV C++ Error

Started by
5 comments, last by Mad_Koder 18 years, 5 months ago
Okay , I have redone some stuff, and now I get these errors,I had more related to -lglu32 and -lopengl32 when I didnt include them in the linker, but when I added them and the -glut32 file in the linker, I still get errors. I am using DEV C++ v 4.9.9.2 ____________________________________ Here is the code for the glut program: #include <windows.h> #include <gl\glut.h> void RenderScene(void) { glClear(GL_COLOR_BUFFER_BIT); glFlush(); } void SetupRC(void) { glClearColor(0.0f,0.0f,1.0,1.0); } int main(void) { glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutCreateWindow("Simple"); glutDisplayFunc(RenderScene); SetupRC(); glutMainLoop(); } ___________________________________ And here is the errors: [Linker error] undefined reference to `__glutInitWithExit@12' [Linker error] undefined reference to `__glutCreateWindowWithExit@8 [Linker error] undefined reference to `__glutCreateMenuWithExit@8' C:\Program Files\Dev-Cpp\Makefile.win [Build Error] [Glut_Man.exe] Error 1 _____________________________________________ I think it has to do with DEV C++ not able to make the file a .EXE, and I am pretty sure it has to do with Glut also. What is the problem, I have had a problem for a while now (like 3 or 4 weeks and I bet it is something little I just missed, or did not do) ? Thank you
Dont need one.... i'm so cool, dont ask me just do what you do..... meet me in the trap its going down....
Advertisement
Now there is only 1 error left, it is this:

C:\Program Files\Dev-Cpp\Makefile.win [Build Error] [SAD.exe] Error 1

Any advice to what is wrong, is it that DEV C++ cannot make it a EXE
Dont need one.... i'm so cool, dont ask me just do what you do..... meet me in the trap its going down....
Dev C++ can make .exe, but I am not sure what your problem is.
When you make openGL programs with dev, don't you have to start by using this:

"New/project/multimedia/openGL" and work off that file? I would copy your work so far and paste it on that.
I posted a link on your other thread, so I don't know if you tried that or not, but here it goes:

1. Download the GLUT DevPak.

2. To install it, simply double click on the file and install it, just keep on hitting next until it's done.

3. Create a new Win32 Console project. Copy and paste in your code:
#include <windows.h>#include <gl\glut.h>void RenderScene(void){glClear(GL_COLOR_BUFFER_BIT);glFlush();}void SetupRC(void){glClearColor(0.0f,0.0f,1.0,1.0);}int main(void){glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);glutCreateWindow("Simple");glutDisplayFunc(RenderScene);SetupRC();glutMainLoop();}


4. Hit Alt+P to bring up the Project Options dialog. Click on the 'Parameters' tab. Paste in this block into the "Linker" box:
-lglut32-lmingw32-lopengl32-lglu32-lgdi32-lwinmm


5. Build, ctrl+f9, then Run, ctrl+F10. It should work fine with no problems, it did for me.

If you still get errors, chances are you will need to uninstall your DevCpp and delete the folder. Then redownload the latest version again and install, then follow these steps again.

Also make sure you do not have multiple copies of GLUT in your DevCPP folder as well.
Thanks Drew, I tried that and I did before, and this is stil the errors I get:

(the main one I am wondering about is the
"C:\Program Files\Dev-Cpp\Makefile.win [Build Error] [Project2.exe] Error 1
one, but here are all the errors again if it helps)



C:\Program Files\Dev-Cpp\Makefile.win [Build Error] [Project2.exe] Error 1
[Linker error] undefined reference to `__glutCreateMenuWithExit@8'
[Linker error] undefined reference to `__glutCreateWindowWithExit@8'
[Linker error] undefined reference to `__glutInitWithExit@12'

I will uninstal DEV C++ and delete all the opengl files, maby that will do it.
Dont need one.... i'm so cool, dont ask me just do what you do..... meet me in the trap its going down....
Yea, you will need to install DevCpp to a folder without spaces in it, for example C:\DevCpp. When it has spaces, weird errors are introduced because of parsing and directories and stuff. Uninstall, then reinstall to your C:\DevCpp folder and see if that fixes it. Make sure you install that DevPak as well.

In either case, I think you have multiple copies of GLUT on your PC, so it's mislinking the libraries. I still reccomend an uninstall, delete folder, then reinstall. Make sure there is not a lingering GLUT32.DLL in your System32 directory either.
Okay thanks, I wll try that and see if that helps.
Dont need one.... i'm so cool, dont ask me just do what you do..... meet me in the trap its going down....

This topic is closed to new replies.

Advertisement