MinGW assembler/linker error

Started by
17 comments, last by WaterMonkey314 16 years ago
Yeah, g++ is part of gcc, there would be a djgpp g++ as well which would conflict with the MinGW one. try "g++ --version" too.
Advertisement
I moved the MinGW path thingy to before the DJGPP one, but it's still not working. (and I think I might have broken DJGPP, too.-I'm getting the cc1plus error with gpp, which used to work.)

It seems that I either have a problem with cc1plus and/or the assembler.

Running Code::Blocks with it auto-detecting MinGW also returns an assembler error. (or the cc1plus error if I didn't re-install the workaround.)

Thank you guys again for the help.
Do you still need DJGPP? If not simply uninstall djgpp and mingw and try to get rid of all paths that where set by these applications.

Last step: install the code::blocks package that ships with mingw and let us know if that finally works:
Code::Blocks + mingw package
-----PARPG - open source isometric 2d old school RPG still looking for interested contributors
Done. Now MinGW works! (sort of)

It still can't find the OpenGL files properly. I put them where I thought they should go, and also added those filepaths to their respective search directories. That still yields this: (This also seems to explain all those "junk" things the earlier installs were complaining about)

PS: The source code is in Dev-Cpp because I put all my stuff there and don't want to move it...the actual .o and .h files are with Code::Blocks, though.

Quote:
Compiling: C:\Dev-Cpp\ICS\OpenGL\testgl.cpp
Linking console executable: C:\Dev-Cpp\ICS\OpenGL\testgl.exe
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x1c): undefined reference to `___glutInitWithExit@12'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x3d): undefined reference to `___glutCreateWindowWithExit@8'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x5d): undefined reference to `___glutCreateMenuWithExit@8'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x1ed): undefined reference to `_glShadeModel@4'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x218): undefined reference to `_glClearColor@16'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x236): undefined reference to `_glMaterialfv@12'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x254): undefined reference to `_glMaterialfv@12'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x272): undefined reference to `_glLightfv@12'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x293): undefined reference to `_glLightfv@12'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x2b4): undefined reference to `_glLightfv@12'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x2d2): undefined reference to `_glLightfv@12'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x2f3): undefined reference to `_glLightfv@12'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x314): more undefined references to `_glLightfv@12' follow
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x38d): undefined reference to `_glLightModelfv@8'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x39c): undefined reference to `_glEnable@4'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x3ab): undefined reference to `_glEnable@4'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x3ba): undefined reference to `_glEnable@4'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x3d4): undefined reference to `_glClear@4'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x3f1): undefined reference to `_glutSolidSphere@16'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x3f9): undefined reference to `_glutSwapBuffers@0'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x424): undefined reference to `_glViewport@16'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x433): undefined reference to `_glMatrixMode@4'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x43b): undefined reference to `_glLoadIdentity@0'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x465): undefined reference to `_gluPerspective@32'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x474): undefined reference to `_glMatrixMode@4'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x47c): undefined reference to `_glLoadIdentity@0'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x4ba): undefined reference to `_gluLookAt@72'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x530): undefined reference to `_glLoadIdentity@0'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x56e): undefined reference to `_gluLookAt@72'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x576): undefined reference to `_glutPostRedisplay@0'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x57d): undefined reference to `_glutFullScreen@0'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x593): undefined reference to `_glutReshapeWindow@8'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x5aa): undefined reference to `_glutPositionWindow@8'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x61e): undefined reference to `_glRotatef@16'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x626): undefined reference to `_glutPostRedisplay@0'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x653): undefined reference to `_glRotatef@16'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x65b): undefined reference to `_glutPostRedisplay@0'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x685): undefined reference to `_glRotatef@16'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x68d): undefined reference to `_glutPostRedisplay@0'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x6b7): undefined reference to `_glRotatef@16'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x6bf): undefined reference to `_glutPostRedisplay@0'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x700): undefined reference to `_glutInitWindowSize@8'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x724): undefined reference to `_glutInitDisplayMode@4'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x747): undefined reference to `_glutReshapeFunc@4'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x756): undefined reference to `_glutKeyboardFunc@4'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x765): undefined reference to `_glutSpecialFunc@4'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x774): undefined reference to `_glutDisplayFunc@4'
C:\Dev-Cpp\ICS\OpenGL\testgl.o:testgl.cpp:(.text+0x77c): undefined reference to `_glutMainLoop@0'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
47 errors, 0 warnings
Add these linker flags to the code::blocks project and let us know if that resolves it:
opengl32
glu32
-----PARPG - open source isometric 2d old school RPG still looking for interested contributors
Great!

you will also need to get and add glut (or freeglut) to your linker flags, though if you did not get any compilation errors regarding the glut header, you probably already have it.

Just add glut as well as mvBarracuda said, sorry, I have no experience with code::blocks, but I do know they should go into the "additional libraries" or something-along-those-lines field.

Cheers!
Hurrah! 23 errors now! (better, I'm almost there).

I'm not sure if Code::Blocks has a thing where I can just add the opengl library file without finding it, and I'm not sure where it went/is. I did get glu.o, glu32.o, glut32.o, and glaux.o linked, though.
Quote:Original post by WaterMonkey314
Hurrah! 23 errors now! (better, I'm almost there).

So post the remaining linker errors; otherwhise it's pretty hard to help you.

Quote:Original post by WaterMonkey314
I'm not sure if Code::Blocks has a thing where I can just add the opengl library file without finding it, and I'm not sure where it went/is. I did get glu.o, glu32.o, glut32.o, and glaux.o linked, though.

Are you sure you mean glu32.o? MinGW / linux libraries use an .a file extension while .o files are compiled object files.

If you decided to install the Code::Blocks + MinGW package linked above it should simply work if you follow these steps:
1. Open Code::Blocks project file for the software you're trying to build.
2. Project >> Build options... >> Linker settings.
3. Add your linker flags there, but don't use the file browser to search for an .a file. Instead simply type in the library name (e.g. libopengl32.a) and press OK.
4. Build your project.

-----PARPG - open source isometric 2d old school RPG still looking for interested contributors
Hurrah! It works! Thank you guys so much for the help.

This topic is closed to new replies.

Advertisement