Objective Systems is pleased to announce availability of ASN1C runtime libraries for the iPhone.

Given the ubiquity of ASN.1 applications and the likelihood of more of them being needed on the iPhone, we have begun supporting ASN1C runtime libraries compiled against the iPhone OS. We currently only build our libraries against the version 3.1.3 SDK, but we can build against 2.2.1 as well.

Support for the iPhone brings our phone support full-circle, with libraries compiled against SymbianOS, multiple versions of Windows CE, Android, and Java Micro Edition.

Using ASN1C-generated sources with the iPhone is very straightforward. Typically programs for the iPhone are coded in Objective-C, Apple's object-oriented answer to the C programming language. Even though ASN1C doesn't emit Objective-C code, Objective-C is a strict superset of the C language, so any Objective-C compiler will compile C code generated by ASN1C.

Objective-C will also work with regular C++ code as well. There are, however, some caveats to this, as outlined by Apple in their developer guide. The main point of concern is that the object model used in Objective-C is incompatible with the one used in C++; therefore, C++ classes may not inherit from Objective-C classes and vice versa.

Those interested in deploying applications on the iPhone OS are encouraged to examine Apple's iPhone Application Programming Guide for a full reference on the subject.

Compiling code for the iPhone is surprisingly easy (at least in this developer's experience), even if you're not using the XCode IDE. Objective Systems provides a platform.mk file that should contain all the necessary definitions for compiling against the iPhone SDK, provided that it is installed in the default location. A sample compilation will look a bit like this:

/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc [...] -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk  -arch armv6 -mthumb [...] writer.c

The relevant observations (obviously some text has been removed for clarity):

  1. gcc is invoked from the iPhoneOS platform directory.
  2. The ARM architecture is targeted (-arch armv6) using the thumb instruction set (-mthumb).
  3. The SDK root is set using the -isysroot switch.

That's really all there is to it. Questions or comments? Email us at support and we'll be glad to help.


Published

Category

ASN1C