We have recently developed a working application for an Android device using Eclipse and all the other Ultralite stuff. Pretty easy to get going and works fairly nicely.
No we are ramming our heads against the wall trying to get the Iphone version up and running. We are using Xcode 4 (which is all you can download now) but the Iphone tutorial appears to have been written for Xcode 3. There are massive changes to IDE and trying to follow the tutorial is frustrating to say the least. I'll bet the tutorial is simple and straightforward if one were to have Xcode 3 installed.
In any event, has anyone ever successfully written a Sync app using Xcode 4 and Ultralite? I would love to get the simple tutorial working. Things like GCC_PREPROCESSOR_DEFINITIONS are hard to find in Xcode 4. Also should we be using the Apple compiler or the GCC 4.2 ? If someone could shed some light it would be greatly appreciated
asked 29 Nov '11, 09:10
(There are significant changes in Xcode 4. However, I've found that Apple's stuff is generally well thought out, even if it has a bit of a learning curve. An initial investment in learning how they do things should be well paid back later. Trying to force other systems' paradigms won't make you happy :)
Everything should work fine with Xcode 4 given an adjustment or two. Let's go at your specific problems until everything works...
As Bill mentioned, there's a change required to make the UltraLite runtime library build. (This has already been fixed here, but the EBF isn't posted yet.) Here's the description for that change:
The UltraLite runtime library for iPhone fails to build with recent Xcode/SDKs (Xcode 4.2 with iOS 5.0 SDK, for example) because gcc-4.2 is no longer shipped (the command is not found while trying to run build.sh). This problem can be worked-around by creating a symlink for gcc-4.2 -> gcc in the /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin and similar Simulator directories, or by modifying the makefile or build.sh used by UltraLite.
I can give you specific details about how to do this. The best alternative is probably to edit build.sh and add 'GCCSUF=' (no quotes) to the make command line (after XCODE=$XCODE, around line 88).
You should not have to do anything with GCC_PREPROCESSOR_DEFINITIONS, or anything like that. You will have to add libulrt.a to your project, and add SQLAnywhere/sdk/include to the include paths. UltraLite also relies on the CFNetwork and Security frameworks for synchronization.
By 'Apple compiler' do you mean LLVM? llvm-gcc will work fine. (That is, the LLVM code generator using the GCC front-end.) We have not experimented much with the clang front-end here, but you should be able to use that for compiling your app code.
answered 29 Nov '11, 12:09
I'm not sure if all developer licenses provide the same offerings, but I'm still able to access a Xcode 3.2.6 download with iOS 4.3 SDK. Once logged into the iOS developer center, there is a link for Xcode 3.
With that said, we are working on our Xcode 4.2 support and will provide in an EBF when it is ready (no ETA at this point). One of the changes includes updating the UltraLite runtime build script to use /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc for building. For my Xcode 4.2 this is a link to llvm-gcc-4.2.
An update for the tutorial was not planned as part of the work. I'm not sure when someone will be able to take a look at the tutorial, but I will add it to the list.
answered 29 Nov '11, 09:59