简体   繁体   中英

linker command failed with exit code 1 after I upgrade to Xcode 7

After I upgraded to El Capitan and Xcode 7, I cannot build my app. I keep getting duplicate symbols on all of my global variables. Please help.

enter image description here

//Global.h
#ifndef Global_h
#define Global_h

extern NSInteger pickerConstantOne, pickerConstantTwo,numberOfDays, monthOfToday;

NSInteger pickerConstantOne, pickerConstantTwo,numberOfDays, monthOfToday;

#endif /* Global_h */

You have misdeclared those variables; remove this statement from the header:

NSInteger pickerConstantOne, pickerConstantTwo,numberOfDays, monthOfToday;

and move it into a .m file.

You should also review exactly why you are using global variables in the first place as you certainly don't need to be.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM