Archived

This topic is now archived and is closed to further replies.

linking errors

This topic is 5012 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I''m trying to compile some files, with VC++, but I get these errors: Linking... main.obj : error LNK2005: "int nAltura" (?nAltura@@3HA) already defined in jogo.obj main.obj : error LNK2005: "int nLargura" (?nLargura@@3HA) already defined in jogo.obj main.obj : error LNK2005: "struct HINSTANCE__ * hInstance" (?hInstance@@3PAUHINSTANCE__@@A) already defined in jogo.obj main.obj : error LNK2005: "struct HDC__ * hMainDC" (?hMainDC@@3PAUHDC__@@A) already defined in jogo.obj main.obj : error LNK2005: "struct HWND__ * hWnd" (?hWnd@@3PAUHWND__@@A) already defined in jogo.obj main.obj : error LNK2005: "unsigned long nStartTime" (?nStartTime@@3KA) already defined in jogo.obj main.obj : error LNK2005: "struct _iobuf * log" (?log@@3PAU_iobuf@@A) already defined in jogo.obj sll.obj : error LNK2005: "int nAltura" (?nAltura@@3HA) already defined in jogo.obj sll.obj : error LNK2005: "int nLargura" (?nLargura@@3HA) already defined in jogo.obj sll.obj : error LNK2005: "struct HINSTANCE__ * hInstance" (?hInstance@@3PAUHINSTANCE__@@A) already defined in jogo.obj sll.obj : error LNK2005: "struct HDC__ * hMainDC" (?hMainDC@@3PAUHDC__@@A) already defined in jogo.obj sll.obj : error LNK2005: "struct HWND__ * hWnd" (?hWnd@@3PAUHWND__@@A) already defined in jogo.obj sll.obj : error LNK2005: "unsigned long nStartTime" (?nStartTime@@3KA) already defined in jogo.obj sll.obj : error LNK2005: "struct _iobuf * log" (?log@@3PAU_iobuf@@A) already defined in jogo.obj visual.obj : error LNK2005: "int nAltura" (?nAltura@@3HA) already defined in jogo.obj visual.obj : error LNK2005: "int nLargura" (?nLargura@@3HA) already defined in jogo.obj visual.obj : error LNK2005: "struct HINSTANCE__ * hInstance" (?hInstance@@3PAUHINSTANCE__@@A) already defined in jogo.obj visual.obj : error LNK2005: "struct HDC__ * hMainDC" (?hMainDC@@3PAUHDC__@@A) already defined in jogo.obj visual.obj : error LNK2005: "struct HWND__ * hWnd" (?hWnd@@3PAUHWND__@@A) already defined in jogo.obj visual.obj : error LNK2005: "unsigned long nStartTime" (?nStartTime@@3KA) already defined in jogo.obj visual.obj : error LNK2005: "struct _iobuf * log" (?log@@3PAU_iobuf@@A) already defined in jogo.obj visual.obj : error LNK2001: unresolved external symbol "void __cdecl Gera_resultado(unsigned long,struct node *,struct node *,struct node * * *,unsigned long * *,struct node * *,unsigned long *)" (?Gera_resultado@@YAXKPAUnode@@0PAPAPAU1@PAPAKPAPAU1@ PAK@Z) Debug/jogo.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. Most of them say "already defined" but in all my headers I use the directives #ifndef...#define...#endif can someone help me here?

Share this post


Link to post
Share on other sites