注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

BCB-DG's Blog

...

 
 
 

日志

 
 

How to use Freepascal 2.0.0 with the KOL  

2009-05-13 14:47:57|  分类: Delphi |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
With the release of version 2.0.0 the Freepascal team reached a new height in compatibility with Delphi. The Key Objects library has long since supported Freepascal, with a set of conditional defines and special library add-ons. Now, however, the Freepascal 2.0.0 compiler is compatible enough to compile Kol.pas 2.10 without any changes. You can alternatively download a fully prepared package here. That file contains the necessary support files to compile Kol applications and some examples

You can also download only these support files.

Here you can find the very good FPCShell 1.17 editor for Freepascal 2.0.0 that explicitly supports KOL as well!.

Preparing FPC.CFG

In order to work with KOL, we will either have to pass the right compiler settings when we compile, or adapt FPC.CFG. These are my own settings for kolfpc.cfg which have proven to work reliably. I recommend you save the file to the left as kolfpc.cfg in your kol source directory and use the following commandline parameters to compile:

>fpc -n @kolfpc.cfg -dRELEASE <SOURCE>


#Adapt the paths to point to your own FPC directory

-Fuc:\FPC\/units/$FPCTARGET/
-Fuc:\FPC\/units/$FPCTARGET/*
-Fuc:\FPC\/units/$FPCTARGET/rtl
-Fuc:\FPC\kol

# For a release compile with optimizes and strip debuginfo
#IFDEF RELEASE
-Og1p2
-Xs
#KOL
-Mdelphi
-CX
-Sg

#WRITE Compiling Release Version
#ENDIF

# For a debug version compile with debuginfo and all codegeneration checks on

#IFDEF DEBUG
-gcl
-Crtoi
-Sg
#KOL
-Sa
-Mdelphi
#WRITE Compiling Debug Version
#ENDIF

Preparing delphidef.inc


Simply comment ASM_VERSION with a dot like so: {.$DEFINE ASM VERSION} or add {$DEFINE PAS_VERSION}



Example project

In order to check if everything is ok, here's a small example program that we now should be able to compile:

Save it as project1.dpr and compile it like this:

>fpc -n @kolfpc.cfg -dRELEASE project1.dpr

You should end up with a nice executable of about 40K in size.

 


 

program Project1;
{$APPTYPE GUI}
uses
Kol;
begin
Applet:=NewForm(nil,'Basic FPC');
Run(Applet);

end
.

  评论这张
 
阅读(594)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017