好吧,我正在尝试在 xcode 中调用一个函数,但显然它不起作用。我做了一个objective-c类,并在实现文件中输入以下代码:
#import "Person.h"
@implementation Person
void printthis()
{
NSLog(@"Hi, I have been printed");
}
int main(int argc, const char * argv[])
{
@autoreleasepool {
printthis();
}
return 0;
}
@end
显然,它在 xcode 中返回以下错误:
ld: 1 duplicate symbol for architecture x86_64
clang: error:
linker command failed with exit code 1 (use -v to see invocation)