软件工程

本类阅读TOP10

·PHP4 + MYSQL + APACHE 在 WIN 系统下的安装、配置
·Linux 入门常用命令(1)
·Linux 入门常用命令(2)
·使用 DCPROMO/FORCEREMOVAL 命令强制将 Active Directory 域控制器降级
·DirectShow学习(八): CBaseRender类及相应Pin类的源代码分析
·基于ICE方式SIP信令穿透Symmetric NAT技术研究
·Windows 2003网络负载均衡的实现
·一网打尽Win十四种系统故障解决方法
·数百种 Windows 软件的免费替代品列表
·收藏---行百里半九十

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
Using C code in symbian

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

Calling the C function in C++ file (Porting)

1.

Create a header file(.h) for your “c” program. The contents of the header file will look like


#ifdef __cplusplus
extern "C" {
#endif

// functions that you going to call in
C++
void yourFunction( );
void PrintfMessage();
int sum ( int i,int j);
......
......
......

#ifdef __cplusplus
}
#endif

2:

Now create your related “.c“file which includes all the function’s definitions which are declared in the above “.h” files. If required As well other “.c” file whose functions will be called by “.c” functions. For instance, sum( ) will call GetFirstNumber( ) that is in another “.c” file.

3:

Now You have to edit the MMP file. a) Add the filename

SOURCE

b) Add STDLIB’s header.

SYTEMINCLUDE     \epoc32\include\libc

c) The import library estlib.lib is the C standard library.

LIBRARY          estlib.lib

4:

Call yourFunction( ); from C++ file. This C++ file should have the “.h” of the “c” file.

5:

This is only for console based, rest of the steps are same. For, Console based application (i.e., for .exe ) The project also links to ecrt0.lib. This file provides the E32Main() entrypoint for a “.exe”

STATICLIBRARY   ecrt0.lib




相关文章

相关软件