<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="http://blogs.forum.nokia.com/styles/rss.css" type="text/css"?>
<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  xmlns:admin="http://webns.net/mvcb/"
  xmlns="http://purl.org/rss/1.0/"
>
 <channel rdf:about="http://blogs.forum.nokia.com/rss.php?blogId=20776&amp;profile=rss10">
  <title>Harri Salminen&#039;s Forum Nokia Blog</title>
  <link>http://blogs.forum.nokia.com/blog/harri-salminens-forum-nokia-blog</link>
  <description>&lt;p&gt;Random thoughts about mobile (enterprise) application development.&lt;/p&gt;
</description>
    <dc:creator>widianuser</dc:creator>
  <dc:date>2009-11-23T23:35:49Z</dc:date>
  <admin:generatorAgent rdf:resource="http://www.lifetype.net" />
  <items>
   <rdf:Seq>
       <rdf:li rdf:resource="http://blogs.forum.nokia.com/blog/harri-salminens-forum-nokia-blog/2007/08/20/an-open-c-test-drive" />
      </rdf:Seq>
  </items> 
 </channel>
  <item rdf:about="http://blogs.forum.nokia.com/blog/harri-salminens-forum-nokia-blog/2007/08/20/an-open-c-test-drive">
  <title>An Open C test drive</title>
  <link>http://blogs.forum.nokia.com/blog/harri-salminens-forum-nokia-blog/2007/08/20/an-open-c-test-drive</link>
  <dc:description>Some time ago I decided to test drive Open C to see how the first release performs. Instead of writing my own code from scratch, I took an existing open source project and tried to port that to Symbian. Because once upon a time I considered writing my own XMPP Symbian implementation, I downloaded sources for &lt;a id=&quot;d375&quot; href=&quot;http://www.loudmouth-project.org/&quot; title=&quot;Loudmouth&quot;&gt;Loudmouth&lt;/a&gt;, an open source XMPP implementation. Without previous knowledge about Open C or Loudmouth I took the challenge. Below are some notes about my Open C tests. List is not very &quot;scientific&quot; and all comments are more than welcome!&lt;br /&gt;
&lt;br /&gt;
Starting the work was simple: I created a new DLL-type project using Carbide and imported Loudmouth source and header files to correct directories. I was happy to see that MMP-file was updated automatically! After done that, Carbide tried to compile the project and produced a respectable amount of errors and warnings. The reason is that when compiling Loudmouth (or any other source package) to other platforms you&#039;d use provided configuration scripts to create makefiles. For Open C that didn&#039;t work and configuration must be done manually. Basically there are two issues to solve:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;which macros to define for compilation?&lt;/li&gt;
    &lt;li&gt;which libraries are required for linking?&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Writing configuration manually is not as bad as it sounds: I created new header file named &quot;configure.h&quot; and copied the initial contents from skeleton file configuration.h.in. Luckily enough, the skeleton file was well commented and after a couple of trials and errors I got a working configuration file.&lt;br /&gt;
&lt;br /&gt;
Because I was compiling a shared library, I had to add EXPORT_C and IMPORT_C directives by hand.&lt;br /&gt;
&lt;br /&gt;
There is a nice set of string conversion utilities in directory s60opencexOpenCStringUtilitiesExLibrary. I didn&#039;t find any references to those from documentation.&lt;br /&gt;
&lt;br /&gt;
When compiling the sources I had to make a couple of changes to support Symbian. There were only few places that needed fixing and/or &quot;#ifdeffing&quot; with __SYMBIAN32__ macro:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;glib/gi18n.h includes libintl.h that wasn&#039;t included in Open C package (bug?). I simply commented that line out.&lt;/li&gt;
    &lt;li&gt;For target build there was error &quot;stdapis/machine/endian.h error: impossible constraint in `asm&#039;&quot;.&amp;#160; I added new preprocessor directive #ifdef __SYMBIAN32__ #define&amp;#160;&amp;#160; &amp;#160;_BYTEORDER_FUNC_DEFINED #endif to solve that&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
For IP-address resolving I found a strange issue: I wasn&#039;t able to get getaddrinfo() to work, but gethostbyname() seems to be OK. Can anyone else confirm this?&lt;br /&gt;
&lt;br /&gt;
To run the application in target device, it is a must to install also the Open C runtime libraries, probably the best way to do this is to embed the required SIS files to one big installation file. Open C documentation seems to lack the list of required runtime libraries, but the information can be found from readme-file.&lt;br /&gt;
&lt;br /&gt;
Readme file contains an error: UID for openc_ssl.sis is wrong in readme-file, correct uid is 0x10281F34.&lt;br /&gt;
&lt;br /&gt;
After these steps I was able to run a small test application that linked with Loudmouth XMPP library and sent some XMPP messages to test server. I&#039;m sure there are lots of things to polish if I continue work with this project, after all I haven&#039;t really tested the results of my small project. But anyway: getting an XMPP library compiled for Symbian takes much less time than reading and understanding the &lt;a id=&quot;gl9k&quot; href=&quot;http://www.ietf.org/rfc/rfc3920.txt&quot; title=&quot;spec&quot;&gt;actual protocol specifiction&lt;/a&gt;.</dc:description>
      
    <dc:subject>Open C</dc:subject>
     
    
  <dc:date>2007-08-20T22:38:29Z</dc:date>
    <dc:creator>widianuser</dc:creator>
 </item>
 </rdf:RDF>