on 2011 Nov 29 9:10 AM
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
(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.
Additional pointers:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tim - Wow! Thanks for the quick and knowledgable response. Much of what you outlined has been done. Here is where we are at:
1) The Ultralite runtime library build worked without any modifications. We have the file libulrt.a and it is added to the project
2) We added the include directory to the include path
3) Both the CFNetwork and Security Frameworks have been added
4) We have it set to use the Apple LLVM compiler 3.0 - We can change it to use the LLVM GCC 4.2
Using the Apple LLVM compiler 3.0 we see a bunch of errors in the Ultralite .h files. For instance in ulprotos.h we get errors of the sort:
Parse Issue Must use 'enum' tag to refer to type 'ul_database_propery_id'
In ulglobals.h we see: Semantic Issue Type specifier missing, defaults .....
I think we may be close but there is a compiler option that is off.
@Codecranker: I have felt free to change your posting into a comment to Tim's answer as it seems more of a further question...
You can directly add a comment with the help of the "add new comment" button right below each question/answer.
We will look into making the headers build clean.
For now I guess you can ignore the warnings or use the GCC front-end.
Oh - I forgot to mention that you must compile (at least the modules calling UltraLite) as "Objective-C++" rather than "Objective-C". Do this either by creating modules with a .mm extension (instead of .m), or change the build setting "Compile Sources As" to "Objective-C++".
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the info Bill. The problem is we went out and bought a brand new MacBook Pro to develop an iPhone application against our version 12 Sybase ASA DB. The latest offerings from Apple come pre-installed with OS X Lion 10.7.2. From what I've read there is no chance of getting the old Xcode 3 up and running on the Lion platform. You need to partition your drive (something I'de rather not do) and install OS X Leopard 10.6 so that you can dual boot into the old OS.
I am going to give this a shot and see if it works but I'm surprised at how cumbersome it is to get a synchronized app going using Ultralite and the IOS architecture. Much of this has to do with the Xcode programming environment. While Apple has created something that is very easy for the end user to use, the recommended development environment of Xcode (at least version 4) is the most convoluted mess I have ever worked with. Give me back CodeWarrior for the love of Mike!!!!!!
Thanks!
User | Count |
---|---|
68 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.