🔒 Locked
redeclaration of C++ built-in type
Advertisement
Original Post
I'm trying to get OpenGL set up with Dev C++ and it's not going so well... I get this error when I try to compile. 50 C:\Dev-Cpp\include\GL\glut.h redeclaration of C++ built-in type `wchar_t' From when I can gather I'm not the only 1 w\ this problem. This problem is the standard is there can not be two identical type defs. The reason this isn't a show stopper is VC++ isn't standards compliant, it just lets anything fly. So all VC++ users are fine, don't ever know this conflict exists. But the rest of us using standards compliant compilers such as Dev C++'s MinGW or what ever they call it... any way no 1 i have found so far has figured a solution, PLZ HELP!
UPDATE:
I commented out line 50 and that error goes away.
But then I get 10 million link errors :(
example:
[Linker error] undefined reference to `__glutInitWithExit'
wtf why does the opengl god hate me so...
I commented out line 50 and that error goes away.
But then I get 10 million link errors :(
example:
[Linker error] undefined reference to `__glutInitWithExit'
wtf why does the opengl god hate me so...
Yes both are from Nate or who the guy who ported it to win32 was.
Is the commenting out line 50 a good idea or should i find a different work around?
Is the commenting out line 50 a good idea or should i find a different work around?
Quote:
Original post by Wavesonics
Is the commenting out line 50 a good idea or should i find a different work around?
Sure, hack it away - if the header doesn't work, it does you no good. I did the same thing when I started using VS.NET, which had changed the declaration for exit() and abort() - adding a noreturn attribute.
Your best bet in any case would be to recompile GLUT from source, that way, you'd be sure everything is clean. May I suggest FreeGLUT? Unlike the original GLUT, it is still being maintained, and the license terms are better (you can redistribute a modified copy). It also comes with a Dev-C++ package, apparently.
awesome thx man. Ok got an interesting development. Some 1 in another forum linked me 2 some OpenGL projects and I compiled 1 of them and ya know what?
NO LINK ERRORS!!!! WTF?! they use the exact same include I do for glut.h!
Heres the difference. It's a "Project" so it has it's own link parameters. But I copied them strait into my global link parameters so everything compiled should be the same now. But my sample code is still busted. How could 1 give me link errors and 1 not?!
Heres the exact linking I use:
-L"C:\Dev-Cpp\lib" -lopengl32 -lglu32 -lglut32
NO LINK ERRORS!!!! WTF?! they use the exact same include I do for glut.h!
Heres the difference. It's a "Project" so it has it's own link parameters. But I copied them strait into my global link parameters so everything compiled should be the same now. But my sample code is still busted. How could 1 give me link errors and 1 not?!
Heres the exact linking I use:
-L"C:\Dev-Cpp\lib" -lopengl32 -lglu32 -lglut32
ya it really really does hate me :(... it's gotta b something w\ the code or something i have no idea. just doesnt make sense this 1 project would compile while the other would give linking errors...
I just compile a file with:
#include
thats it and i still get 3 errors... Heres the full compile log:
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Dev-Cpp\my code\openGL\my code\test\stupid.cpp" -o "C:\Dev-Cpp\my code\openGL\my code\test\stupid.exe" -I"C:\Dev-Cpp\include\c++" -I"C:\Dev-Cpp\include\c++\mingw32" -I"C:\Dev-Cpp\include\c++\backward" -I"C:\Dev-Cpp\include" -I"C:\Dev-Cpp\include\GL" -L"C:\Dev-Cpp\lib" -lopengl32 -lglu32 -lglut32
C:\DOCUME~1\ADAMBR~1\LOCALS~1\Temp/ccK0baaa.o(.text+0x15):stupid.cpp: undefined reference to
C:\DOCUME~1\ADAMBR~1\LOCALS~1\Temp/ccK0baaa.o(.text+0x4c):stupid.cpp: undefined reference to
Execution terminated
#include
thats it and i still get 3 errors... Heres the full compile log:
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Dev-Cpp\my code\openGL\my code\test\stupid.cpp" -o "C:\Dev-Cpp\my code\openGL\my code\test\stupid.exe" -I"C:\Dev-Cpp\include\c++" -I"C:\Dev-Cpp\include\c++\mingw32" -I"C:\Dev-Cpp\include\c++\backward" -I"C:\Dev-Cpp\include" -I"C:\Dev-Cpp\include\GL" -L"C:\Dev-Cpp\lib" -lopengl32 -lglu32 -lglut32
C:\DOCUME~1\ADAMBR~1\LOCALS~1\Temp/ccK0baaa.o(.text+0x15):stupid.cpp: undefined reference to
__glutInitWithExit'
C:\DOCUME~1\ADAMBR~1\LOCALS~1\Temp/ccK0baaa.o(.text+0x30):stupid.cpp: undefined reference to __glutCreateWindowWithExit'C:\DOCUME~1\ADAMBR~1\LOCALS~1\Temp/ccK0baaa.o(.text+0x4c):stupid.cpp: undefined reference to
__glutCreateMenuWithExit'
C:\Dev-Cpp\lib/libmingw32.a(main.o)(.text+0x7f):main.c: undefined reference to WinMain@16'Execution terminated
MAN....it's always the same, on every compiler, on every platform,...CHECK YOUR PROJECT AND LINKER SETTINGS!!!
...But if you cannot setup your little program to compile properly what if you're getting _real_ compile errors? Post them immediately to some boards?? Fine! *being sarcastic* :(
I'm sure we hear from you again if you add another 3rd party library...*gg*
best regards
- christoph -
...But if you cannot setup your little program to compile properly what if you're getting _real_ compile errors? Post them immediately to some boards?? Fine! *being sarcastic* :(
I'm sure we hear from you again if you add another 3rd party library...*gg*
best regards
- christoph -
Just realized why that 1 project worked.
It's not using Glut. only gl and glu... feck feck feck FEEECCKK!!!
Time to blast some shit in halo...
It's not using Glut. only gl and glu... feck feck feck FEEECCKK!!!
Time to blast some shit in halo...
Look in the header file see if there are references to glutInitWithExit, glutCreateWindowWithExit and glutCreateWindowWithExit, like, for example, taking their address (function pointers?).
You can also get your preprocessor to dump the list of macros it has implicitely defined (IIRC, cpp -dM) -- see if things are different in the project that worked. Or compare the preprocessed output, see if the naughty bits are taken out somehow, or actually made correct.
Does MinGW-g++ need to link to other libraries to provide WinMain, or is that the usual entry point?
Also, see if using FreeGLUT makes things better.
You can also get your preprocessor to dump the list of macros it has implicitely defined (IIRC, cpp -dM) -- see if things are different in the project that worked. Or compare the preprocessed output, see if the naughty bits are taken out somehow, or actually made correct.
Does MinGW-g++ need to link to other libraries to provide WinMain, or is that the usual entry point?
Also, see if using FreeGLUT makes things better.
i am no expert in this but i have had the same sort of problems while trying to compile managed types with none managed types, i would suggest this if you do not want to use a 3rd party glut.
it may solve your problem but may also create more problems i am unsure of this.
(edit: ignore me if u feel the need as i am probably to inexperienced in this to be of any help)
#undef wchart_t#include <glut.h>it may solve your problem but may also create more problems i am unsure of this.
(edit: ignore me if u feel the need as i am probably to inexperienced in this to be of any help)
Ok that project I thought was working is only using gl and glu...
But Dev C++ generates templates 1 of which is a basic open GL window which WAS compiling eariler 2 nite and now does not. So I just need to reset all my fucking headers and libs. This FreeGlut seems to b native to Linux, having a lil trouble finding the win32 binaries but ill keep looking.
But Dev C++ generates templates 1 of which is a basic open GL window which WAS compiling eariler 2 nite and now does not. So I just need to reset all my fucking headers and libs. This FreeGlut seems to b native to Linux, having a lil trouble finding the win32 binaries but ill keep looking.
OH SWEETNESS!!! they have a free glut package specificaly for dev c++!!! I LOVE U GUY!!!
oo... ssoo... close...
All the errors are gone except this:
76 C:\Dev-Cpp\my code\openGL\my code\template\main.cpp
`exit' undeclared (first use this function)
All the errors are gone except this:
76 C:\Dev-Cpp\my code\openGL\my code\template\main.cpp
`exit' undeclared (first use this function)
I do a compile of just:
#include
and get the following error:
cannot find -llibfreeglut
WTF!!!! i know its there im looking at the damn thing!
#include
and get the following error:
cannot find -llibfreeglut
WTF!!!! i know its there im looking at the damn thing!
awesome ok fixxed the exit problem. Now no matter which lib i use it says it cant b found...
Both the libfreeglut.a and libglut32.a
opengl really does hate :(....
so close too so close...
Both the libfreeglut.a and libglut32.a
opengl really does hate :(....
so close too so close...
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement