当前位置: 代码迷 >> Symbian >> 用纯C写的库如何在symbian中使用呢
  详细解决方案

用纯C写的库如何在symbian中使用呢

热度:3626   发布时间:2013-02-26 00:00:00.0
用纯C写的库怎么在symbian中使用呢?
如题,怎么才能正常使用C库呢?

库大致是这样的
#include   "stdafx.h "
//文件:lib.cpp
#include   "testFile.h "
#include   "stdio.h "
int   TestCreateFile(const   char*   aFileName)
{
FILE   *   fp   =   fopen(aFileName,   "w ");
if(!fp)   return   0;
fputs(aFileName,   fp);
return   1;
}

int   Test123(int   a,int   b)
{
return   a+b;
}


#ifndef   LIB_H
#define   LIB_H
extern   "C "{
int   TestCreateFile(const   char*   aFileName);  
int   Test123(int   a,int   b);
}
#endif

在symbian   中我这样使用,不知道为什么不行
在ui.h
#include   "testfile.h "

ui.cpp

constructL()
{
...
TestCreateFile(iFileName);
...
}
 
*.mmp
STATICLABRARY         testfile.lib

此文件我已经复制到相应的目录下
release\winscw\udeb
release\armv5\lib\
release\armv5\urel\


请问整个过程有什么错误吗??

------解决方案--------------------------------------------------------
Using C code in symbian
http://www.newlc.com/Using-C-code-in-symbian