Series 60 SDK 2.1 for VC++ 入门指南

来源:互联网 发布:dojo.js下载 编辑:程序博客网 时间:2024/04/29 09:49

作者:fishyqd         mail:dawei_zhang81@163.com         wei_zhang@sjtu.edu.cn
一,安装

(1)       安装VC++ 6.0,如果已经安装,检查是否设置了环境变量。

如果没有设置环境变量,按如下方法,进行设置。

方法一,在我的电脑-〉属性-〉高级-〉环境变量里面的path路径前加入:
D:/Microsoft Visual Studio/Common/Tools/WinNT;D:/Microsoft Visual Studio/Common/MSDev98/Bin;D:/Microsoft Visual Studio/Common/Tools;D:/Microsoft Visual Studio/VC98/bin;

其中D:/Microsoft Visual Studio是VC安装路径

   方法二,运行D:/Microsoft Visual Studio/VC98/Bin下有一个VCVARS32.BAT的小程序可以用来恢复环境变量的设置。

 

(2)       安装Symbain SDK 我是安装到C:/下。

设置环境变量:

1,先添加环境变量

EPCROOT为/Symbian/7.0s/Series60_v21_C/。

2,  环境变量里面的path路径前加入   C:/Symbian/7.0s/Series60_v21_C/Epoc32/gcc/bin;C:/Symbian/7.0s/Series60_v21_C/Epoc32/tools;

(3)          安装ActivePerl-5.8.8.817-MSWin32-x86-257965.msi。默认所以选项就可。

 

二,构建项目

构架Helloworld工程

1)在命令行中转入到路径:C:/Symbian/7.0s/Series60_v21_C/Examples/helloworld下,

运行:

bldmake bldfiles

运行后会在这个目录下生成,abld.bat文件

2)运行:

abld makefile vc6

运行后会生长VC++工程,是这个项目的调试版本。对于把SDK装在C:/的用户来说,生成的工程文件在:

C:/Symbian/7.0s/Series60_v21_C/Epoc32/BUILD/SYMBIAN/7.0S/SERIES60_V21_C/EXAMPLES/HELLOWORLD/HELLOWORLD/WINS下

3)用VC++打开.dsw工程文件,即可用VC++进行编辑和调试。在运行程序的时候VC++会弹出一个对话框要求可执行文件。 输入C:/Symbian/7.0s/Series60_v21_C/Epoc32/release/wins/udeb/epoc.exe 然后你就会看到熟悉的"hello world"出现在s60模拟器上了!

   (4)用命令行编译和构建项目。

    运行命令abld build wins wdeb可以编译项目。编译后,直接在命令行运行epoc就可以启动刚编译后的项目。

下边摘录一段SDK中对与构建和运行命令的解释文档:

Create the build files and build the application

With the abld command available, perform the following steps to create the needed build files:

1.                  Open the command prompt and go to the application folder, which now contains the abld.bat file.

For example,
<SDK_installation_directory>/Series60_v21/Series60Ex/helloworldbasic/group/

2.                  Enter the following command and press Enter:

abld build <target> udeb

In the command above, substitute <target> with the token associated with the appropriate SDK as follows:
- wins for SDK supporting Microsoft Visual Studio C++ .NET IDE 
- winscw for SDK supporting Metrowerks CodeWarrior C++ IDE
- winsb for SDK supporting Borland C++ Builder IDE

In other words, if you are building for the he Series 60 SDK 2.1 supporting Microsoft Visual Studio C++ .NET, enter the wins token in the command:

abld build wins udeb

Notice, that you have now built a debug build of the Hello World example application (that is, debug-type binaries), which you can run on the debug emulator. This build appropriate for your purposes at this point, as this enables you to run and view the application in the Series 60 debug emulator.

The build process creates the necessary build files and application binaries, including any resource files required.

Note: There is also a release emulator provided with the SDK, but you will not need it for building and running example applications - the debug emulator is sufficient for this purpose. However, if you would like to build an application for the release emulator, perform the steps above, but replace the udeb with urel in the abld build command:

abld build <target> urel

This produces a build the application for the release emulator (that is, release-type binaries).

If the udeb / urel token is omitted from the command, both debug and release type binaries will be produced.

This stage of the process may produce warnings. If there are errors, it may be because the exports of a DLL component were not frozen. If the application has a DLL component, you need to freeze the exports by performing the following steps.

1.                  In the application group folder, enter the following command:
abld freeze

For example,
<SDK_installation_directory>/Series60_v21/Series60Ex/helloworldbasic/group/abld freeze


This ensures that the exports are frozen. To use the frozen exported interfaces, the application needs to be re-built after the freeze.

2.                  Rebuild the application after freezing the exports by entering the build command:
abld build <target> udeb
For example,
<SDK_installation_directory>/Series60_v21/Series60Ex/helloworldbasic/group/abld build wins udeb

 

三 常见问题:

1)运行abld build wins udeb 时出现:

MMPFILE "/SYMBIAN/7.0S/SERIES60_V21_C/EXAMPLES/HELLOWORLD/HELLOWORLD.MMP" WARNING(S) /SYMBIAN/7.0S/SERIES60_V21_C/EXAMPLES/HELLOWORLD/HELLOWORLD.MMP(20) : SYSTEMINCL UDE path "/Symbian/7.0s/Series60_v21_C/EPOC32/INCLUDE/TECHVIEW/" not found
直接在路径/Symbian/7.0s/Series60_v21_C/EPOC32/INCLUDE/建立一个文件夹命名为:TECHVIEW

(2)       运行abld build wins udeb 时出现:

make -r -f "/Symbian/7.0s/Series60_v21_C/EPOC32/BUILD/SYMBIAN/7.0S/SERIES60_V21_C/SERIES60EX/HELLOWORLDPLUS/GROUP/VC6.make" MAKEFILE VERBOSE=-sperl -S makmake.pl -D /SYMBIAN/7.0S/SERIES60_V21_C/SERIES60EX/HELLOWORLDPLUS/GROUP/HELLOWORLDPLUS VC6'LINK.EXE' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
ERROR: failed to find version information for LINK.EXE
make: *** [MAKEFILEHELLOWORLDPLUS] Error 2

 

VC6的系统环境变量没有配置好,在我的电脑-〉属性-〉高级-〉环境变量里面的path路径设置含有类似:
 D:/Microsoft Visual Studio/Common/MSDev98/Bin;D:/Microsoft Visual Studio/Common/Tools;D:/Microsoft Visual Studio/VC98/bin;

 

(3)       运行abld build wins udeb 时:

出现了警告:没有找到mspdb60.dll

解决方法同(2),VC++路径配置问题

(4)       运行abld build wins udeb 时出现:

ERROR: EPOCROOT must be an absolute path without a drive letter
BEGIN failed--compilation aborted
……

 

EPOCROOT环境变量的设置问题,对此这个版本的设置,必须”/”开始,如:/Symbian/7.0s/Series60_v21_C/

C:/Symbian/7.0s/Series60_v21_C/和Symbian/7.0s/Series60_v21_C/都不对。

 

另外,对于不同版本的SDK,EPOCROOT也不尽相同,要区别对待,好像有的只要设置为”/”.

 

原创粉丝点击