奇怪的构建错误:重复的符号canVirate

时间:2011-06-23 14:52:12

标签: iphone build compiler-warnings

以下是我的构建日志。我有什么想法可以解决这个问题?我已经尝试了所有常用的错误修复解决方案:删除构建文件夹,清理,重新启动XCode等。

  

Ld的   构建/调试-iphonesimulator / SquirrelGame.app / SquirrelGame   正常的i386 cd   /用户/学生/桌面/ SquirrelGame   setenv MACOSX_DEPLOYMENT_TARGET 10.6   setenv PATH   “/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin”   /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2   -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk   -L /用户/学生/桌面/ SquirrelGame /编译/调试,iphonesimulator   -F /用户/学生/桌面/ SquirrelGame /编译/调试,iphonesimulator   -F / Users / Student / Desktop / SquirrelGame -filelist /Users/Student/Desktop/SquirrelGame/build/SquirrelGame.build/Debug-iphonesimulator/SquirrelGame.build/Objects-normal/i386/SquirrelGame.LinkFileList -mmacosx-version-min = 10.6 -all_load -ObjC -Xlinker -objc_abi_version -Xlinker 2 -weak_framework Foundation -weak_framework UIKit -framework CoreGraphics -framework AudioToolbox   -framework CFNetwork -framework CoreLocation -weak_framework MapKit   -framework QuartzCore -framework Security -framework   SystemConfiguration -lsqlite3.0   -framework MediaPlayer -framework AVFoundation -framework MessageUI   -framework MobileCoreServices -framework AddressBook -framework AddressBookUI -weak_framework GameKit   -lz.1.2.3 -framework OpenFeint -o /Users/Student/Desktop/SquirrelGame/build/Debug-iphonesimulator/SquirrelGame.app/SquirrelGame

     

ld:重复符号_canVirate in   /Users/Student/Desktop/SquirrelGame/build/SquirrelGame.build/Debug-iphonesimulator/SquirrelGame.build/Objects-normal/i386/SquirrelGameViewController.o   和   /Users/Student/Desktop/SquirrelGame/build/SquirrelGame.build/Debug-iphonesimulator/SquirrelGame.build/Objects-normal/i386/SquirrelGameAppDelegate.o collect2:ld返回1退出状态   命令   /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2   退出代码1失败

1 个答案:

答案 0 :(得分:0)

没有代码很难说,所以请发布canVirate定义。 通常该错误意味着canVirate是头文件中定义的全局变量。编译器在包含标头的每个模块中创建变量。您应该在标头中声明canVirate,但在SomeModule.m文件中定义它:

SomeModule.h:

extern int canVirate;

SomeModule.m:

int canVirate = 123;