By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,208 Members | 1,592 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,208 IT Pros & Developers. It's quick & easy.

HELP for error LNK 2005

P: 1
Hi i am working on a graphical user interface deisgn programme. when i compile the file i i get the following output with the mentioned errors:

1>------ Rebuild All started: Project: guiq, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'guiq', configuration 'Debug|Win32'
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>Custom Message.cpp
1>guiq.cpp
1>Generating Code...
1>Compiling...
1>sip.cpp
1>Compiling managed resources...
1>Read in 0 resources from "d:\Profiles\srekhi\My Documents\Visual Studio 2005\Projects\guiq\guiq\sip.resx"
1>Writing resource file... Done.
1>Read in 0 resources from "d:\Profiles\srekhi\My Documents\Visual Studio 2005\Projects\guiq\guiq\Custom Message.resx"
1>Writing resource file... Done.
1>Compiling resources...
1>Linking...
1>Custom Message.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>guiq.obj : error LNK2005: "struct HINSTANCE__ * hInst" (?hInst@@3PAUHINSTANCE__@@A) already defined in guiq.obj
1>guiq.obj : error LNK2005: "wchar_t * szTitle" (?szTitle@@3PA_WA) already defined in guiq.obj
1>guiq.obj : error LNK2005: "wchar_t * szWindowClass" (?szWindowClass@@3PA_WA) already defined in guiq.obj
1>guiq.obj : error LNK2005: "int __stdcall About(struct HWND__ *,unsigned int,unsigned int,long)" (?About@@YGHPAUHWND__@@IIJ@Z) already defined in guiq.obj
1>guiq.obj : error LNK2005: "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) already defined in guiq.obj
1>guiq.obj : error LNK2005: "int __cdecl InitInstance(struct HINSTANCE__ *,int)" (?InitInstance@@YAHPAUHINSTANCE__@@H@Z) already defined in guiq.obj
1>guiq.obj : error LNK2005: "unsigned short __cdecl MyRegisterClass(struct HINSTANCE__ *)" (?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z) already defined in guiq.obj
1>guiq.obj : error LNK2005: _wWinMain@16 already defined in guiq.obj
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>d:\Profiles\srekhi\Desktop\FTP\Debug\guiq.exe : fatal error LNK1169: one or more multiply defined symbols found
1>Build log was saved at "file://d:\Profiles\srekhi\My Documents\Visual Studio 2005\Projects\guiq\guiq\Debug\BuildLog.htm"
1>guiq - 9 error(s), 2 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========


i am using microsoft visual studio 2005 standard edition and language is C++

Could anyone please help me by guiding me on how to remove these errors please.

thanks

Sahil
Sep 7 '07 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
You have a lot of redefinition errors:
1>guiq.obj : error LNK2005: "struct HINSTANCE__ * hInst" (?hInst@@3PAUHINSTANCE__@@A) already defined in guiq.obj
for example. Do you have multiple global variables of the same name? Read this.

The LNK4075 is caused by Custom Message.cpp which refers to MSIL which leads me to believe this is Managed C++ and you are using the /clr option and may be caused by the LNK2005 errors.

Exactly what kind of project have you set up??
Sep 7 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.