Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiply defined symbols - LNK2005 1

Status
Not open for further replies.

gabeo

Programmer
May 5, 2004
4
US
I have read the previous threads on this problem and haven't been able to fix it. I am getting several link errors similar to the following:
error LNK2005: _exit already defined in msvcrt.lib(msvcr71.dll)

There are several other symbols that are reported as already defined - all dealing with the same two files. This program compiles fine in VC6; the problem occurs when I compile in VC++ .NET (Windows 2003 Server)
Any help would be appreciated. Thanks.

-Gabe
 
maybe you have #included accidentally sone .c or .cpp files?

Ion Filipski
1c.bmp
 
If that were the case, it wouldn't compile in VC6 correct?
 
I just did a search - no c or cpp files are included.
 
Great, try to search what library also contains this function, or if this function is implemented somewhere inside one of your projects and use linker parameter /NODEAFULTLIB:somelibname, or remove the implementation from your projects. There is enough for example the function to be declared as

... exit(){}

instead of

... exit();

Ion Filipski
1c.bmp
 
OK - finally. After doing the same search in google and deciphering them all, I found the solution. I was getting an error when linking in VC6, but since it was a warning and didn't affect anything (and it was there for so long) I have been ignoring it. After converting to .NET, it was no longer a warning, but I still didn't even notice it. The warning was LIBC coflicts with other libraries; use /NODEFAULTLIB. I did this and it fixed the problem. Thanks for your help, gentlemen!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top