Delphi工程转为lazarus :
1.备份代码
2.lazarus菜单tools子菜单 Convert Delphi Project to Lazarus Project ..
转换时会提示无效属性,点Remove all invalid properties按钮。
3.打开lazarus 工程 (*.lpr),在工程源文件(*.lpr)uses第一行插入
{$IFDEF LCLWINCE} bwintf,{$ELSE} interfaces, {$ENDIF}
这一行是增加图像驱动的单元,在Wince下使用bwintf,是为了解决ce下unicode汉字显示及计算的问题。
4.在界面单元中凡是使用到TSpinEdit的在interface uses中增加cespin单元引用。
lazarus中没有这个控件.
5.在界面单元中凡是使用到TPageControl的在interface uses中增加cepagectl单元引用。
lazarus中控件工作不正常.
6.wince编译:
菜单Project | compiler options 打开窗口
第一个标签 Paths: LCL Widget Type(various) 设为"wince"
第三个标签 Code : Target OS 设为 "Wince" , Target CPU 设为 "arm"
最后一个标签 Compilation : Execute after 框 Check Compile 和 Build 在Command 输入
arm-wince-strip.exe "$(TargetFile)"
这样可以把编译生成的文件去掉调试信息,缩小文件大小。
如果要调试,可以去掉 check 就可以。
在线调试时需要设置 主菜单 Environment | Debugger Options 对话框 Debugger type and path :
type : GNU debugger(gdb)
path : c:/lazarus/gdbce/gdb.exe
7.win32编译
菜单Project | compiler options 打开窗口
第一个标签 Paths: LCL Widget Type(various) 设为"win32/win64"
第三个标签 Code : Target OS 设为 "Win32" , Target CPU 设为 "i386"
最后一个标签 Compilation : Execute after 框 Check Compile 和 Build 在Command 去掉 check
在线调试时需要设置 主菜单 Environment | Debugger Options 对话框 Debugger type and path :
type : GNU debugger(gdb)
path : c:/lazarus/mingw/bin/gdb.exe 汉字处理:
界面不要放汉字信息?
wince下是unicode,需要转换为ansistring处理。wide2ansi, ansi2wide函数。
转自:http://blog.csdn.net/htmlxp/article/details/4028494
|