Advertisement

Arggh! Damned Redefined Objects

Started by March 24, 2003 05:45 PM
5 comments, last by Invisible_Troll_Union 21 years, 7 months ago
I am currently trying to remake my Pong Game in OpenGL, except these new errors keep coming up. --------------------Configuration: Pong Unlimited Extreme - Win32 Debug-------------------- Linking... Bat.obj : error LNK2005: "void __cdecl glEnable2D(void)" (?glEnable2D@@YAXXZ) already defined in winmain.obj Bat.obj : error LNK2005: "void __cdecl glDisable2D(void)" (?glDisable2D@@YAXXZ) already defined in winmain.obj Bat.obj : error LNK2005: "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z) already defined in winmain.obj Bat.obj : error LNK2005: "int __cdecl InitGL(void)" (?InitGL@@YAHXZ) already defined in winmain.obj Bat.obj : error LNK2005: "void __cdecl KillGLWindow(void)" (?KillGLWindow@@YAXXZ) already defined in winmain.obj Bat.obj : error LNK2005: "int __cdecl CreateGLWindow(char *,int,int,int,bool)" (?CreateGLWindow@@YAHPADHHH_N@Z) already defined in winmain.obj Bat.obj : error LNK2005: "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) already defined in winmain.obj Bat.obj : error LNK2005: "bool fullscreen" (?fullscreen@@3_NA) already defined in winmain.obj Bat.obj : error LNK2005: "bool active" (?active@@3_NA) already defined in winmain.obj Bat.obj : error LNK2005: "struct HWND__ * hWnd" (?hWnd@@3PAUHWND__@@A) already defined in winmain.obj Bat.obj : error LNK2005: "struct HDC__ * hDC" (?hDC@@3PAUHDC__@@A) already defined in winmain.obj Bat.obj : error LNK2005: "struct HGLRC__ * hRC" (?hRC@@3PAUHGLRC__@@A) already defined in winmain.obj Bat.obj : error LNK2005: "struct HINSTANCE__ * hInstance" (?hInstance@@3PAUHINSTANCE__@@A) already defined in winmain.obj Bat.obj : error LNK2005: "class CBat User" (?User@@3VCBat@@A) already defined in winmain.obj Bat.obj : error LNK2005: "class CBat Computer" (?Computer@@3VCBat@@A) already defined in winmain.obj Bat.obj : error LNK2005: "bool * keys" (?keys@@3PA_NA) already defined in winmain.obj Debug/Pong Unlimited Extreme.exe : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe. Pong Unlimited Extreme.exe - 17 error(s), 0 warning(s) I know what these errors mean, but I have no clue on how to go about fixing them? Any Input? We must defeat the trolls! Argh, we ARE the trolls!
KalvinB for moderator!
looks like your trying to redefine some functions and classes (and even variables...)-

combat this by using header guards-

#ifndef class_h
#define class_h

...

#endif


or....

make sure you declare your objects/variables in the .cpp file of a .h/.cpp pair...

or try to find where you are redefining these variables.... (use find...)

hope this helps


ps. daredevil is the worst movie made.
Advertisement
Well, that worked to an extent.

Now I get this link error:

--------------------Configuration: Pong Unlimited Extreme - Win32 Debug--------------------
Compiling...
winmain.cpp
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Pong Unlimited Extreme.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Pong Unlimited Extreme.exe - 2 error(s), 0 warning(s)

Thanks for the input so far.

We must defeat the trolls!
Argh, we ARE the trolls!
KalvinB for moderator!
don't know about that one but
i googled this out for ya mate





[edited by - kuladus on March 25, 2003 5:38:04 AM]
did you make a winmain function?
Wow thanks Kuladus, you have been extremely helpful!

And yes, I do have a WinMain function.
Now it works just fine.

We must defeat the trolls!
Argh, we ARE the trolls!
KalvinB for moderator!
Advertisement
no problemmo

This topic is closed to new replies.

Advertisement