Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
This page was last modified 13:34, 24 June 2008.

Mixing and Compiling of C code on Symbian 3rd Edition

From Forum Nokia Wiki

Imagine you have following C type interfaces

int my_ctype_interface_create(char* msgq_buf_p, int msg_size);
void  my_ctype_interface_send(char* msgq_buf_p,int msg_size);
int my_ctype_interface_recieve(char* msgq_buf_p, int msg_size);
int  my_ctype_interface_open(char* msgq_buf_p,int msg_size);

Now for properly compiling c type interfaces in .h and .cpp files follow the below steps

#ifdef __cplusplus
extern "C" {
#endif
int my_ctype_interface_create(char* msgq_buf_p, int msg_size);
 
 
void  my_ctype_interface_send(char* msgq_buf_p,int msg_size);
int my_ctype_interface_recieve(char* msgq_buf_p, int msg_size);
                                    
int  my_ctype_interface_open(char* msgq_buf_p,int msg_size);
 
 
#ifdef __cplusplus
}
#endif

The above code tells the c++ compiler that the defination of the interfaces are defined at some other place.

Now in .CPP files you can implement the code containng C++ Syntax and API's

Also make the following changes in MMP file

OPTION CW -w implicit -lang c++

This tells the compiler to suppress all typecasting errors, for more such options go to the command prompt type the compiler name with spacw help you will get list of all options supported by the compiler

Add the following Headers & Library in your project
#include <stdlib.h>
LIBRARY 		estlib.lib

Also Visit the Following link [Compilation of C Code on Target]

 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX