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]
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Network Problem in 3rd Ed. Emulator | twlai | Symbian Tools & SDKs | 1 | 2007-01-31 15:11 |
| 模拟器上无法播放音乐,更无法进行摄像 | luckyapplehead | Symbian | 2 | 2008-03-15 13:50 |
| Getting SIM Status in 3rd Edition | saji_iq | General Symbian C++ | 19 | 2008-09-17 14:03 |
| Have you know netmonitor(FTD)? | RC211V | Symbian Networking & Messaging | 1 | 2006-12-12 14:05 |
| Why TPosition class does not have method to calculate the azimuth in S60 3rd edition? | anand_zain76 | General Symbian C++ | 0 | 2006-08-17 10:36 |
