* Created by PB_G4 on 12/4/07.
* Copyright 2007 __MyCompanyName__. All rights reserved.
utilities.c
/*
* utilities.c
* functionstoptrs
*
* Created by PB_G4 on 12/4/07.
* Copyright 2007 __MyCompanyName__. All rights reserved.
*
*/
#include "header.h"
int mystrcmp( char *s, char *t){
for ( ; *s == *t; s++, t++)
if( *s== '\0')
return 0;
return ( ( *s > *t) - ( *t > *s) );
}
The error message is a follows.
Building target “functionstoptrs” of project “functionstoptrs” with configuration “Release” — (1 error)
cd "/..../functionstoptrs"
/Developer/usr/bin/gcc-4.0 -o /..../functionstoptrs/build/functionstoptrs.build/Release/functionstoptrs.build/Objects-normal/ppc/functionstoptrs -L
/......./functionstoptrs/build/Release -F/......./functionstoptrs/build/Release -filelist /......./functionstoptrs/build/functionstoptrs.build/Release/functionstoptrs.build/Objects-normal/ppc/functionstoptrs.LinkFileList -arch ppc -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk
ld: duplicate symbol _mystrcmp in /........../functionstoptrs/build/functionstoptrs.build/Release/functionstoptrs.build/Objects-normal/ppc/utilities.o and /........../functionstoptrs/build/functionstoptrs.build/Release/functionstoptrs.build/Objects-normal/ppc/main.o
collect2: ld returned 1 exit status
ld: duplicate symbol _mystrcmp in /........../functionstoptrs/build/functionstoptrs.build/Release/functionstoptrs.build/Objects-normal/ppc/utilities.o and /Users/m/k&R/functionstoptrs/build/functionstoptrs.build/Release/functionstoptrs.build/Objects-normal/ppc/main.o
collect2: ld returned 1 exit status
Build failed (1 error)
I understand that the compiler believes mystrcmp is being duplicated, but I am not sure I understand why this is happening.
Could someone help me become unstuck?
thank you in advance.