- 论坛徽章:
- 0
|
#include<stdio.h>
#include<string.h>
char * __cdecl strcpy(char * dst, const char * src)
{
char * cp = dst;
while( *cp++ = *src++ )
; /* Copy src over dst */
return( dst );
}
void main()
{
char *p="abcdddddddddd",*pp="ddddd";
strcpy(pp,p);
printf("%10s",pp);
}
这个程序complie可以,但是build有2个错误。
--------------------Configuration: 1 - Win32 Debug--------------------
Linking...
LIBCD.lib(strcat.obj) : error LNK2005: _strcpy already defined in 1.obj
Debug/1.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
1.exe - 2 error(s), 0 warning(s)
请问是什么原因??
[ 本帖最后由 heiniu532 于 2005-12-30 12:39 编辑 ] |
|