Today, after porting an open-source code to a Windows vc6 project, these strange Link errors occur during compilation.
++
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ toupper already defined in libcd. Lib (toupper. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ tolower already defined in libcd. Lib (tolower. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ isupper already defined in libcd. Lib (_ ctype. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ isalpha already defined in libcd. Lib (_ ctype. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ free already defined in libcd. Lib (dbgheap. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ realloc already defined in libcd. Lib (dbgheap. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ atol already defined in libcd. Lib (atox. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ malloc already defined in libcd. Lib (dbgheap. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ wcslen already defined in libcd. Lib (wcslen. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ strdup already defined in libcd. Lib (strdup. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ memmove already defined in libcd. Lib (memmove. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ strrchr already defined in libcd. Lib (strrchr. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ isspace already defined in libcd. Lib (_ ctype. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ strchr already defined in libcd. Lib (strchr. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ isalnum already defined in libcd. Lib (_ ctype. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ isdigit already defined in libcd. Lib (_ ctype. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ isxdigit already defined in libcd. Lib (_ ctype. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ strncmp already defined in libcd. Lib (strncmp. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ localeconv already defined in libcd. Lib (lconv. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ sprintf already defined in libcd. Lib (sprintf. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ exit already defined in libcd. Lib (crt0dat. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ floor already defined in libcd. Lib (floor. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ stricmp already defined in libcd. Lib (stricmp. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ getenv already defined in libcd. Lib (getenv. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ atoi already defined in libcd. Lib (atox. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ atof already defined in libcd. Lib (atof. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ fclose already defined in libcd. Lib (fclose. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ strcspalready defined in libcd. Lib (strcspn. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ fwrite already defined in libcd. Lib (fwrite. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ fputc already defined in libcd. Lib (fputc. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ strtol already defined in libcd. Lib (strtol. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ strncpy already defined in libcd. Lib (strncpy. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ isctype already defined in libcd. Lib (isctype. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ strnicmp already defined in libcd. Lib (strnicmp. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ strstr already defined in libcd. Lib (strstr. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ isprint already defined in libcd. Lib (_ ctype. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ strtodd already defined in libcd. Lib (strtodd. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ fopen already defined in libcd. Lib (fopen. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ fflush already defined in libcd. Lib (fflush. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ calloc already defined in libcd. Lib (dbgheap. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ abort already defined in libcd. Lib (abort. OBJ)
Msvcrt. Lib (msvcrt. dll): Error lnk2005: _ islower already defined in libcd. Lib (_ ctype. OBJ)
++
According to the prompts, there is a symbol conflict between msvcrt. Lib (msvcrt. dll) and libcd. Lib!
As a result, the linker finds that a symbol is defined at two points during the link and does not know the link. Thus, the lnk2005 Link error is reported.
You can forcibly generate a DLL or EXE file by checking "force file output" in the Project Settings.
For more information about this option, see:Http://msdn.microsoft.com/en-us/library/70abkas3.aspx