Re: [fpc-pascal] fpmake: output directories

2009-06-06 Thread Peter Vreman

Maybe this can be used for debug/release.
I don't see how this can be used for the widgetsets.

Why not ? you can use
  subtarget=gtk2-debug


How can I pass sub targets to fppkg?


fppkg -c

You can already use this now for cross-compiling. Under Linux you can 
test it with:

- Copy ~/.fppkg/config/default to ~/.fppkg/config/win32
- Change target in ~/.fppkg/config/win32 to win32
- Start "fppkg -cwin32 install fpc-all"



The point is that the LCL must be installed in the package system, so
fppkg knows about it. That means an additional copy operation.

If you don't want that, then we must see about 'registering' local
build trees in fppkg; By this I mean that fppkg assumes that all is
installed under

~user/.fppkg/build/

(or something like it)

if you don't want this, you should be able to tell it that it should
also look in e.g.

/path/to/lazarusdir/components/

To find additional packages there.


If root installs some packages for all users and I want to add some
extra packages. Can fppkg handle this?


Yes. It supports a Global and a Local directory. The local directory has 
a higher preference.


Peter
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Records as properties and Delphi compiler error

2009-06-06 Thread fpclist
Hi Guys,

Is there a reason why the following code fails to compile in Delphi but 
compile in FPC? Could the reason be that FPC allows the use of global 
properties? Tested with Delphi 5 and up.

The Delphi compiler complains about the lines:
TestClass.TestRec.X := 10;
TestClass.TestRec.Y := 20; within the button click handler.
Delphi Error:  "Left side cannot be assigned to"

//***
unit Unit1; 

(*
This code sample is written for use with Lazarus.
The Delphi equivalent fails to compile using Delphi.
*)

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
Button1 : TButton;
procedure Button1Click(Sender : TObject);
  private
  public
  end;

  TTestRec = record
X : Byte;
Y : Byte;
  end;

  TTestClass = class
  private
fTestRec : TTestRec;
  public
property TestRec : TTestRec read fTestRec write fTestRec;
  end;

var
  Form1 : TForm1; 

implementation

procedure TForm1.Button1Click(Sender : TObject);
var
  TestClass : TTestClass;

begin
  TestClass := TTestClass.Create();
  try
ShowMessage('TestRec before' + #13 +
'X = ' + IntToStr(TestClass.TestRec.X) + #13 +
'Y = ' + IntToStr(TestClass.TestRec.Y));

TestClass.TestRec.X := 10; //* Error "Left side cannot be assigned to"
TestClass.TestRec.Y := 20 ;//* Error "Left side cannot be assigned to"

ShowMessage('TestRec after' + #13 +
'X = ' + IntToStr(TestClass.TestRec.X) + #13 +
'Y = ' + IntToStr(TestClass.TestRec.Y));

  finally
FreeAndNil(TestClass);
  end;
end;

initialization
  {$I unit1.lrs}

end.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Records as properties and Delphi compiler error

2009-06-06 Thread Jonas Maebe


On 06 Jun 2009, at 17:36, fpcl...@silvermono.co.za wrote:

Is there a reason why the following code fails to compile in Delphi  
but

compile in FPC? Could the reason be that FPC allows the use of global
properties?


No, it's an error in FPC which has been fixed in 2.3.1: 
http://wiki.freepascal.org/User_Changes_Trunk#Treating_direct-mapped_properties_as_regular_fields


Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] TPicture (Graphics unit)

2009-06-06 Thread Leonardo M . Ramé

Hi, I'm porting a Delphi application from Windows to FreeBSD, and one of my 
unit uses the TPicture class. In Delphi this class can be found in 
Graphics.pas, but I can't find it in FPC. Is this class replaced by a similar 
one?

I'm using FPC 2.2.4.
 Leonardo M. Ramé
http://leonardorame.blogspot.com



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal