I just upgraded my Mac to Lion and then Xcode 4.1. My iPhone project which worked well with Xcode 4.0 had 401 errors in Xcode 4.1.
I googled the solution and got two useful ways.
changed the complier from GCC 4.2 to LLVM 2.1.
changed #import "/usr/include/sqlite3.h" to #import <sqlite3.h>
Now the number of errors reduced to 15, saying
Expected function body after function declarator
on OBJC_ARC_UNAVAILABLE in file Runtime.h, which is a built-in source file.
I tried to change iOS Deployment Target from iOS 3.0 to iOS 4.1 and set Other C Flags as
-D__IPHONE_OS_VERSION_MIN_REQUIRED=040100
But neither of them worked.
Any help will be appreciated. Thank you.
I had the same issue, and was able to resolve it by changing this
#import "/usr/include/objc/runtime.h"
to this
#import <objc/runtime.h>
where ever I included this file. This change appears backward compatible with 4.0.2 running under Snow Leopard as well.
Related
I'm facing the issue with distributing compiled swift framework. My framework heavily relies on the libxml2 dynamic library. In order to avoid issues with Swift module compatibility, I've set build flag BUILD_LIBRARY_FOR_DISTRIBUTION = YES.
So I've used Xcode 11.3 Swift v5.1.3 to build my framework. I've integrated it into the Demo.app project. As being expected Demo.app works fine in Xcode 11.3.
However, I have another error trying to build Demo.app in Xcode 11.0 Swift 5.1.
I've got the error:
#import "libxml/HTMLparser.h"
^
/Applications/Xcode_11.0.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator13.0.sdk/usr/include/libxml2/libxml/HTMLparser.h:15:10: error: 'libxml/xmlversion.h' file not found
#include <libxml/xmlversion.h>
^
/.../DemoApp/ThirdParty/testXML.framework/Modules/testXML.swiftmodule/x86_64-apple-tvos-simulator.swiftinterface:6:8: error: could not build Objective-C module 'libxml2'
import libxml2
^
/.../DemoApp/AppDelegate.swift:11:8: error: failed to load module 'testXML'
import testXML
Here is the repo with both framework and app projects.
I'm using both Xcode version on the same Mac.
Your project runs fine on my Xcode 11.3 tvOS simulator. However there's something I've noticed.
The framework you built only contains x86_64 architectures (simulator only), it won't work on physical devices.
For Xcode before 11.3 it seems like you need to add $(SDKROOT)/usr/include/libxml2 and ${SRCROOT}/libxml2 to Build Settings. That fixed the issue for me on Xcode 11.2.1
I'm building iSpeechSDK Beta 3 (released on 2012-05-18) for my sample/test project (iOS Universal app) I just created. I'm getting build time errors.
.....iSpeechSDK/Headers/ISSpeechSynthesis.h:58: error: expected a property attribute before 'unsafe_unretained'
When I double click on the error, it points to the SDK header class: ISSpeechSynthesis.h
..
#property (nonatomic, unsafe_unretained) id delegate;
..
PS: I have added the documented linker flag in other linker flags of Build: -fobjc-arc
I tried building for simulator/device/debug/release but all build targets produce same above error.
Please help me resolve this build error.
System/Development configuration-
Mac OS: 10.6.8
XCode: 3.2.5
iOS SDK: 4.2
You are using wrong complier. LLVM GCC does not supports Strong and other ARC keywords. Please set your complier as LLVM compiler 4.2
I don't believe ARC is supported in Xcode 3.2.5. I believe it was introduced in Xcode 4.2, but you can try changing your Compiler setting to LLVM GCC 4.2 in 'Build Settings'
When I tried to import <SenTestingKit/SenTestingKit.h>, I get this error: SenTestingKit/SenTestingKit.h: No such file or directory.
I am using unit testing for the first. I am using xcode 4.2 with ios 5 sdk. But in my system I have two xcode version installed,4.2 and 3.2.5. Although i am using xcode 4.2 ,xcode3.2.5 is the default xcode in my system. Can any one help me with the unit testing?
SenTestingKit.framework is at :
/Developer/Library/Frameworks/SenTestingKit.framework (OS X)
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOSX.X.sdk/Developer/Library/Frameworks/SenTestingKit.framework (iOS)
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulatorX.X.sdk/Developer/Library/Frameworks/SenTestingKit.framework (simulator)
for Xcode versions 4.3 and above prepend /Applications/Xcode.app/Contents/ to the paths above
I don't know, but the frameworks path will be different for both xcodes. it might be in 3.2.5 frameworks path and when using 4.2, it may not find it. Correct me if I'm wrong.
Probably is a stupid thing but I'm quite new with Xcode... Today I've updated to OS X Lion and XCode 4.1 but now when I try to compile my iPhone app more than 400 compiling errors appear, some of them are even from sqlite3.h, CLLocation.h and other original libraries from Apple. All errors seem to be originated by a problem with #import ...
Yesterday I was working with OS X Snow Leopard with Xcode 4.0 and all was fine. I'm using GCC 4.2 compiler in Xcode and I haven't change any configuration on Xcode or my app.
Here are some errors:
http://img10.imageshack.us/img10/7585/screenshotyum.png
Help please!
UPDATE:
Ok, I solved the problem. It was not related with the compiler version or the base SDK, the error was that Xcode 4.1 doesn't accept the #import "/usr/include/sqlite3.h", it has to be change to #import <sqlite3.h>
More info here (only Apple Developers)
Hope this will help to other people.
This caused me some serious headaches so thanks for posting! To clarify, after updating to Lion and Xcode 4.1 I had 400 errors because of: #import "/usr/include/sqlite3.h" but changing it to #import <sqlite3.h> solved it! Took me ages to figure this out!!!
I am using iphone_sdk_3.0_beta_5__9m2735 SDK.
When I try to compile my code using simulator 3.0 option I get following error. The code compiles for rest all simulator option ie 2.0, 2.1, 2.2, 2.2.1
While compiling my code I get following error
from /Users/videomac/manish/EXPLab/2009-05-27-11-20 myApp_LL_2/myApp_Prefix.pch:7:
In file included from /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:30,
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h:11: error: syntax error before 'AT_NAME' token
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h:19: error: syntax error before '}' token
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UILocalizedIndexedCollation.h:21: fatal error: method definition not in #implementation context
The errors are located in file UILocalizedIndexedCollation.h which is SDK file.I am using UIKit Framework of SDK 3.0. Can anyone tell me what should I do to remove this error?
I've traced this problem to be the compiler version being used. From what I can tell, [REDACTED] requires GCC 4.2 while iPhone SDK 2.x only works with GCC 4.0.
Here's a way to fix this.
In your Target Info, select Build separator and look for the section Compiler Version. Then:
Select the C/C++ Compiler Version row
Set the default to GCC 4.0
At the bottom-left control, hit Add Build Setting Condition
On the left, choose Device - iPhone OS 3.0
On the right, chose GCC 4.2
Repeat steps 3 to 5, now with Simulator - iPhone OS 3.0 on step 4.
Appleās engineer had confirmed that they had a bug in UIKit framework:
We do have a simple workaround for this UIKit bug. In UILocalizedIndexedCollation.h change this:
UIKIT_EXTERN #interface UILocalizedIndexedCollation : NSObject
to
UIKIT_EXTERN_CLASS #interface UILocalizedIndexedCollation : NSObject
Denis2342
Firstly you should discuss beta products here.
However, this is not connected with the beta. You have an error in one of your own header filesprobably a missing '#end' statment.
BTW, google could have solved this for you rather than asking here.