symbian oggplay 音乐播放器开发

来源:互联网 发布:linux vsftpd 目录 编辑:程序博客网 时间:2024/05/20 18:03
by   juwen
http://juwen.blog.51cto.com/135311/117610

这里开始进行第一编译,经常下载开源项目下来调试的朋友都知道,第一次编译是成功的关键,因为很多时候开源项目下载下来后由于机器本身的差异或者环境的差异,软件的差异,很多时候都不能正常编译(好像我觉得是绝大多数都不能一编译就成功)。
 
第一件事就是查看一下下载下来的文档HowToCompile.txt
我将比较关键的部分贴出来,其它自行查看文档。
 /////////////////////////////////////////
  Modules
 /////////////////////////////////////////
 OggPlay comes in two modules.
 An application for OggPlay Application and a dll for the ogg vorbis decoder.
 Because of the plugin nature of the decoder, the application and the decoder
 are separate entities, and each must be compiled separately.
 不一一翻译,大意就是有两部分,程序和解码器,要分开编译。
 
 /////////////////////////////////////////
  Non-MMF and MMF versions
 /////////////////////////////////////////
 
 OggPlay comes in two flavor, the Non-MMF and the MMF version. In the MMF version,
 the ogg vorbis decoder is an MMF Plugin, that can be used by any application,
 like the built-in music player, for instance.
 The MMF version requires OS support for MMF. This support is available from Symbian 7.0s.
 
 Series60 SDK 2.0 or higher is required to compile the MMF version for Series 60.
 
有两个版本,一个是使用MMF的一个是不使用MMF的,根据自己的需要选择编译,别问我MMF是什么。
 
 /////////////////////////////////////////
  Compilation Flags
 /////////////////////////////////////////
 Compilation flags should be set before starting to do any compilation.
 All compilation flags are in OggOs.h.
 There are several flags in that file, but basically, only 5 flags should be
 modified, the others are ok as they are.
 
 #define SERIES60  : When set, compilation is done for S60
 #define UIQ       : When set, compilation is done for UIQ
 #define OS70S     : When set, MMF is used.
 #define MOTOROLA      : When set, compilation for Motorola UIQ (A92X)
 #define SONYERICSSON  : When set, compilation is done for P800/P900
 
其实这里你大可以不用理会,因为oggos.h的头文件里并没有这部分的内容,另外放到其它地方。这份文档应该是早期的版本的。由于oggplay包含很多系统的版本,里面的代码会选择性编译。这里以后再说。反正第一次编译就不用理会这么多。暂时我们只需要选择合适的bld.inf就可以了。详细的看文件夹结构。我用s60v3mmf编译。所以直接使用/groups60v3mmf,其它类同。一句话,找你需要的,闲事莫理。
 
 /////////////////////////////////////////
 Compilation for target device
 /////////////////////////////////////////
 
 To compile the code for target ( this expects a valid Symbian Compilation environment):
 
 For non-MMF version:
 
   Edit the file vorbis/group/bld.inf so that oggvorbis.mmp is used.
   cd /vorbis/group
   bldmake bldfiles
   abld build armi
   cd /group  
   bldmake bldfiles
   abld build armi
 For MMF version:
 
   Edit the file vorbis/group/bld.inf so that OggPluginDecoder.mmp is used.
   cd /group  
   bldmake bldfiles
   abld build armi
 
   cd /vorbis/group
   bldmake bldfiles
   abld build armi

 Note that the order is reversed in MMF case: the Application is built first, and the
 MMF plugin built afterward.
 
到编译命令了。这里可以说就是问题的关键地方,开始时由于我对symbian的开发环境不是很熟悉,我在这里走了不少弯路。我没有直接用命令行,而是使用carbide c++来进行编译,结果死活都出了几个link错误。上google找,一条相同的信息都没有。
Severity and Description PathResource Location Creation Time Id Undefined symbol:'_ogg_sync_bufferin'[] oggplay Unknown 1228526161234 1072
 
几条类似的错误。各个版本都尝试编译,结果都是差不多的错误。然后我再尝试用命令行来编译。
 运行 abld build armi 时提示
This project does not support platform.
这个还好解决,上网找了找。原来这里分winscw、gcce、armv5,具体内容不说了。自己查查资料吧。我是安装了gcc的工具链。所以改一改代码。
abld build gcce urel
 
play/groupS60V3MMF/OGGPLAYS60V3MMF/GCCE/OGGPLAYS60V3MMF.GCCE" RESOURCEUREL
make[1]: *** No rule to make target `/Symbian/Carbide/symbianoggplay/bitmaps/s60
v3mmfsplash.bmp', needed by `/Symbian/9.2/S60_3rd_FP1/EPOC32/DATA/Z/private/F000
A661/OggSplash.mbm'.  Stop.
make: *** [RESOURCEOGGPLAYS60V3MMF] Error 2
  make -r  -f "/Symbian/9.2/S60_3rd_FP1/EPOC32/BUILD/Symbian/Carbide/symbianoggp
lay/groupS60V3MMF/GCCE.make" TARGET CFG=UREL VERBOSE=-s
make -s  -r -f "/Symbian/9.2/S60_3rd_FP1/EPOC32/BUILD/Symbian/Carbide/symbianogg
play/groupS60V3MMF/OGGSHAREDS60V3MMF/GCCE/OGGSHAREDS60V3MMF.GCCE" UREL
utf8fix.c
cc1.exe: warning: command line option "-Wno-ctor-dtor-privacy" is valid for C++/
ObjC++ but not for C
In file included from /Symbian/Carbide/symbianoggplay/SHARED/OggShared.h:23,
                 from /Symbian/Carbide/symbianoggplay/SHARED/utf8fix.c:38:
/Symbian/9.2/S60_3rd_FP1/EPOC32/include/e32def.h:2803: error: initializer elemen
t is not constant
make[1]: *** [/Symbian/9.2/S60_3rd_FP1/EPOC32/BUILD/Symbian/Carbide/symbianoggpl
ay/groupS60V3MMF/OGGSHAREDS60V3MMF/GCCE/UREL/utf8fix.o] Error 1
make: *** [TARGETOGGSHAREDS60V3MMF] Error 2
  make -r  -f "/Symbian/9.2/S60_3rd_FP1/EPOC32/BUILD/Symbian/Carbide/symbianoggp
lay/groupS60V3MMF/GCCE.make" FINAL CFG=UREL VERBOSE=-s

还是有错,追到底了。又一轮搜索,查资料。后来看了一位大哥的文章,估计开始时是函数导出有问题。
Hi jacjames, 
 
Frozen exports are a common issue whendealing with a DLL type projects unfortunately. I'm not sure exactlyhow to work it out through CodeWarrior but if you type 'abld freezewinscw' on a command prompt while inside the /group directory you'llget those exports frozen. After that you should be able to compilenormally on CodeWarrior or on the command prompt ('abld build winscwudeb' is the command).  
 
In the off chance that it doesn't work(abld is tricky) delete the BMARM and BWINS (if there is one)directories. Don't worry, abld should recreate them. 
 
Regards, 
Francisco Pimenta 
 
我也有样学样,先
abld freeze winscw

再编译。竟然通过了。期间会有些提示找不到s60v3mmfsplash.bmp之类的错误,自己做个图片上去就行了。