Xcode 4 to Xcode 3.2 Compatability - xcode

I have an app written that compiles and runs fine in Xcode 4.2. I want to port it into Xcode 3.2 (I have the compatibility option check marked) but Xcode 3.2 gives me an error for some reason. Does anyone know what the issue with this could be?
Additional info:
Base SDK: iOS 4.3
The code in question:
[[self navigationController] pushViewController:adminViewController animated:YES];
Xcode 4:
Xcode 3.2:
Error:
! Expected expression before "adminViewController"

The Xcode project compatibility flags in Xcode 4 are quite redundant. The flag sets the underlying project format and doesn't handle support for the versions of the iOS SDK you're programming for and the versions of the Objective C language and runtime.
If you can open the project in Xcode 3 (as it looks like you can) then it's 'compatible' as far as Xcode is concerned. If you're seeing compiler errors then your issue is to do with running your code older/different versions of the iOS SDK / LLVM / GCC.

Related

<unknown>:0: error: Swift does not support the SDK 'MacOSX10.12.sdk'

I'm on macOS 10.13.3 and I created a new fresh macOS project with Xcode(9.2). Without any custom code I changed the Base SDK from 10.13 (wich is default) to 10.12 in the Build Settings of the target. When I build it I get this error: <unknown>:0: error: Swift does not support the SDK 'MacOSX10.12.sdk'. I also changed the version (Base SDK) to 10.2 for macOS Deployment Target. I also changed the two locations for the Project Settings. But it does not compile. I always get this error. I can't imagine that swift is not backward compatible. Even to change the swift version from 4 to 3.2 has no effect. Is there really no way to compile this new fresh project for SDK 10.12 or even 10.10? Any help is highly appreciated.
What I did before:
To be able to change the version of the BaseSDK within Xcode,
I downloaded the SDK's from here: https://github.com/phracker/MacOSX-SDKs. I edited the info.plist file in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer There I deleted this two lines of code:
<key>MinimumSDKVersion</key>
<string>10.11</string>

ld: library not found for -lcrt1.3.1.o error while running app in device with xcode 8.0 with iOS10

After upgrading xcode to 8.0, my application project build with error for device target but building successfully for simulator.
Error is like:
ld: library not found for -lcrt1.3.1.o
What does the solution for this error.
After spending lots time, i finally got the reason for this error.
Error: ld: library not found for -lcrt1.3.1.o
Solution:
If your project source have deployment target from iOS 5.0 then change it to iOS 6.0 or later and your error will be fix. Now that work fine for device too.
Hurray!!!
crt1.3.1.o is a library that was included in older iOSes (and thus, their SDKs) but is no longer present in newer SDKs.  However, when the project's Deployment Target is set to an older iOS (<6.0, as #Sandy has found), Xcode still tries linking against it.
To keep supporting iOS 5.x in newer Xcodes, one only needs to copy crt1.3.1.o from an older Xcode to the appropriate …/usr/lib/ dir in the newer Xcode.  Xcode will only use crt1.3.1.o if the Deployment Target is <6.0— for projects with a Deployment Target ≥6.0 crt1.3.1.o remains unused and the resulting linked binary is identical to what it was pre-…/usr/lib/crt1.3.1.o-addition.
To get a newer Xcode to properly link a project with a iOS 5.x Deployment Target:
Download an older Xcode that still has crt1.3.1.o from https://developer.apple.com/downloads/.
I used Xcode 5.1.1, though any Xcode that has iOS 5.x support should work (which, according to Wikipedia should be Xcode 4.2-6.4).
Open the Xcode .dmg and on the disk image, locate the file at /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS….sdk/usr/lib/crt1.3.1.o.
Since I used Xcode 5.1.1, mine was at …/iPhoneOS7.1.sdk/usr/lib/crt1.3.1.o.
Copy to the same Xcode.app-relative directory in your newer Xcode: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/crt1.3.1.o.
My newer-Xcode at time of writing is the latest release, Xcode 8.1 (which out-of-the-box includes the iOS 10.1 SDK and downloadable iOS Simulator support back to iOS 8.1).
Note that you'll need to re-perform these steps after each Xcode upgrade, since the standard Xcode update process is to just blow away Xcode.app and everything contained within with the updated Xcode.app.
Also note that I've successfully tested this using Xcode 8.1 to produce an app with a Deployment Target of iOS 5.0 that'll run on both my iOS 10.1.1 iPad Air 2 & my iOS 6.1.3 iPhone 4S.  I have not, however, submitted a build using this process to the iOS App Store.  While it's unlikely that Apple's certification would have a problem with this (since it is after all their own iOS crt1.3.1.o library; and since there is no other way to build an app against the latest SDK while still supporting iOS back to 5.x, which is almost certainly something that some enterprise clients are still doing), I can't make a firm promise here.
remove the -lPods-(someCocoaPod) lines in the 'Other Linker Flags' list BUT only if $(inherited) is at the top. At first I was unsure, but the reassuring sign was that I still saw references to my cocoapods when I left the edit mode(inherited). I tested in debug and release, both of which were giving me errors, and the problem was immediately resolved
Instead of using the libraries from an older Xcode install, you can also just recompile them from sources: https://github.com/mringwal/csu-ios

Architecture not supported - Xcode error

I'm getting these errors whenever I'm trying to run my code on iPad device. Can't seem to figure out the solution here. Tried changing build configurations but it doesn't work. As I have to support for upcoming iOS releases for my app, I'm using SDK6.1 in Xcode 5.1 with deployment target set as iOS 7.1.
Tried this solution Xcode 5 and iOS 7: Architecture and Valid architectures but not working for me. Help!
You are probably compiling for arm64. I don't know if arm/types.h is set up to handle it, but you could try changing
#elif defined(__arm__)
to
#elif defined(__arm__) || defined(__arm64__)
for that include. Or remove arm64 from "Valid Architectures" in build settings (including pods and subprojects).

Upgrade Jam-based targets to native targets in Xcode 4

I'm running Xcode 4.3.2 on Lion and I have a very old Xcode 1.0 project whose targets are Jam-based. When I'm trying to build such a target, Xcode tells me that "Jam is deprecated and has been removed; targets that use Jam must be upgraded to native targets. For more information on doing this, consult the Xcode documentation.".
Unfortunately, neither could I find anything in Xcode 4's documentation, nor could I locate Xcode 3's "Project > Upgrade To Native Target" menu item anywhere in Xcode 4.
How can I do the target conversion in Xcode 4?
From the lack of answers I conclude that there are only two ways to achieve what I wanted:
Either set up Xcode 3 for doing the conversion or
Recreate the project by hand in Xcode 4.

Build error with UILocalNotification with older deployment target in XCode 4

I have a project I am trying to build with XCode 4.1 that built fine on 3.2.5. The base sdk is set to 4.3 and the deployment target is set to 3.2. I've reproduced the problem in a simple project with the following code:
Class notificationClass = NSClassFromString(#"UILocalNotification");
// Make sure local notifications are supported
if (notificationClass)
{
UILocalNotification *taskNotice = [[notificationClass alloc] init];
[taskNotice release];
}
On the UILocalNotification line I get the error: 'UILocalNotification' undeclared (first use in this function)
The relevant settings are:
Compiler: LLVM GCC 4.2 (also tried Apple LLVM compiler 2.1)
Weak-linked: UIKit, Foundation, CoreGraphics
I've scoured Google and Apple's docs and tried everything I could find with no luck. Any help would be greatly appreciated.
Thanks,
Jason
Appears that the problem was because I had the iOS Deployment Target set to 3.2. I've set it to 3.2.1 and now it builds fine. May be due to 3.2 being iPad only but the same thing happened on the iPad version of the app so I'm not sure.
Jason

Resources