[fpc-pascal] Internal linker?

2006-03-03 Thread chromdildo
Hi,

What about the new internal linker ?
Is it already available in the development tree?
What has changed? Any documents to read?

Thanks and best regards.
chrom

 What is new is that the compiler does all the work for you.

 What is still missing, is Win32 support. A DLL is a different beast
 than a shared lib on linux, because it's usually self-contained,
 and because it can't export variables. Mainly, this is package stuff.

 The new internal linker should make this possible...

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

   

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


Re: [fpc-pascal] Compiling library / Win32 DLL

2005-12-29 Thread chromdildo
Thanks for your reply.

Whats the difference, when compiling without Lazarus?
The library relys on the LCL (for GUI) and compiling from commandline
results in exactly the same (non working) dll.
Where can I learn more about the structures, calling conventions, etc
used by freepascal/Lazarus vs. Delphi?

Thanks again and best regards.
chrom


This code(-snippet) compiled with Delphi works perfect (from
www.tobybear.de (GPL))

[code]
{$J-,H+,T-P+,X+,B-,V-,O+,A+,W-,U-,R-,I-,Q-,D-,L-,Y-,C-}
library VstPlugin;
uses
  uPlugin in 'uPlugin.pas',
  uEditor in 'uEditor.pas' {PluginEditorWindow},
  DAEffect;
var Effect : APlugin;
Oome   : Boolean;
function main(audioMaster: TAudioMasterCallbackFunc): PAEffect; cdecl;
export;
begin
 // get vst version
 if audioMaster(nil, audioMasterVersion, 0, 0, nil, 0) = 0 then
 begin
  Result := nil;
  Exit;
 end;
 Effect := APlugin.Create(audioMaster);
 if not Assigned(Effect) then
 begin
  Result := nil;
  Exit;
 end;
 if oome then
 begin
  Effect.Free;
  Result := nil;
  Exit;
 end;
 Result := Effect.Effect;
end;

exports
Main name 'main';

begin
end.
[/code]




Tony Pelton wrote:

you are using FP or its IDE and _not_ lazarus ... right ?

i had some troubles with building a DLL with lazarus, where identical
code would build link under lazarus, and my windows application
wouldn't load it, and everything would work fine when i built it using
the FP compiler standalone.

likely a user error, but i was never able to figure it out.

my $0.02

Tony

On 12/29/05, chromdildo [EMAIL PROTECTED] wrote:
  

Hallo list.

I'm having trouble with library/DLL under Win32 (exporting one function
and having a little GUI).
Compiles fine, but the host application can't load them. The Host is
closed source (think MSVC).

Same code compiles and runs fine with Delphi.

Can someone describe the main differences with building/linking
libraries under Delphi/freepascal.
I'm sure I'm missing some compiler/linker - switch.

Thank you very much
chrom

P.S. Merry Xmas and happy new year to all.


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

  



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


Re: [fpc-pascal] records - really a bug?

2005-05-25 Thread chromdildo
Thanks for the quick reply.
...I see, stupid me. :)

But when the position of amtsbelegung : Tchange_bool; is changed, no
AV occurs ..?
Reproducable?
Something about Memory Acces  I think I got it.

Best regards
./chrom



Florian Klaempfl wrote:

chromdildo wrote:

Well, in your program :) Compile with range checking ot see it.

  

Hello everybody.

I discovered a very strange bug/issue and I don't know how to describe
it best as a bug-report.
(or am I doing something wrong?)
I try: a variable declared within a record, AccessViolates when set
later in code,
if declared at the wong place..?..

(environment: linux/i686 - fpc 2.0.0)
look at this small snipplet: (attached full testing.pas source for
reproduction):

//-snip-
type Teumex_memory = record
 pin  : Tchange_string;
 // amtsbelegung : Tchange_bool;// -- leave it here, everything
is ok.
 msn  : array [0..9] of Tchange_string;
 port : array [0..9] of Tchange_string;
 amtsbelegung : Tchange_bool;// -- put it there: Access
violation when amtsbelegung is set
end;
//-snip-


Best regards
./chrom




program bugtest;

{$mode objfpc}{$H+}

uses classes, sysutils;



type Tchange_string = record
 value: string;
 changed : boolean;
end;

type Tchange_int= record
 value: integer;
 changed : boolean;
end;

type Tchange_bool= record
 value: boolean;
 changed : boolean;
end;

//The internal memory of the eumex (sample)
type Teumex_memory = record
 pin  : Tchange_string;
 
 // amtsbelegung : Tchange_bool;// -- leave it here, everything is 
 ok.

 msn  : array [0..9] of Tchange_string;
 port : array [0..9] of Tchange_string;

 amtsbelegung : Tchange_bool; // -- put it there: Access violation 
 when setting
end;



TEumex = class
private
FMemory : Teumex_memory;
public
   property  Memory  : Teumex_memory read FMemory write FMemory;
end;


var Eumex1  : TEumex;
ic  : integer;


begin
  Eumex1 := TEumex.create;

  writeln ('setting PIN:');
  Eumex1.Memory.pin.value := '1234';
  Eumex1.Memory.pin.changed := true;

  writeln ('setting amtsbelgegung');
  Eumex1.Memory.amtsbelegung.value := true;   // -- Access violation, if 
 declared like above
  Eumex1.Memory.amtsbelegung.changed := true;

  for ic:= 1 to 10 do begin
  Eumex1.Memory.msn[ic].value := '';
  Eumex1.Memory.msn[ic].changed := false;
  Eumex1.Memory.port[ic].value := '0';
  Eumex1.Memory.port[ic].changed := false;
  end;


end.




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




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

  



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


[fpc-pascal] TThread.Synchronize

2005-02-26 Thread chromdildo
Hello guys.
I don't want to annoy you again..
...but what's up with TThread ?
TThread.Synchronize(@myfunction); 
//simply doesn't call myfunction

I can call it directly but not via synchronize.
If not synchronized, gtk+ blows.
What am I doing wrong :(
best regards and thanks for help
./chrom

linux-2.4, fpc 1.9.8, lazarus cvs
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] TThread.Synchronize

2005-02-26 Thread chromdildo
Hallo and thanks for the quick reply.
TThread.Synchronize(@myfunction); //simply doesn't call myfunction
Florian Klaempfl wrote:
 You need to call CheckSynchronize in your main loop. However, 
Sychronize is broken in the 1.9.8 release.

Will this get fixed until 2.0.0 ?
And what about Lazarus LCL, is it calling checksynchronize 
automatically? Does anybody know?

Found this in the Delphi docs:
*function* CheckSynchronize: Boolean;
It is not necessary to call CheckSynchronize in a GUI application. The 
call to CheckSynchronize is made automatically by the application 
object. In a non-GUI application, you must call CheckSynchronize if you 
use the Synchronize method of TThread. To do this, set the 
WakeMainThread variable to a procedure that calls CheckSynchronize.
CheckSynchronize allows background threads to synchronize their 
execution with the main thread, so that it is safe to make method calls 
in the background thread.
CheckSynchronize returns True if a method was synchronized, False if it 
does nothing.

thanks again and best regards
./chrom
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] FPC 1.9.8 - new TThread warning?

2005-02-25 Thread chromdildo
Hello,
Great! just picked it up few minutes before announced :)
now it throws warning (1.9.6 didn't)
Warning: Illegal compiler directive $THREADING
(I used {$THREADING ON} as described in the docs)
I followed the instructions given in the docs about multithreading.
i.e.   {$ifdef unix},cthreads{$endif}
My question: Does something has changed?
Already submitted a bugreport TThread.OnTerminate never gets called 
I still can't get it to work.
Thanks, best regards and keep up this good work
./chrom

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


[fpc-pascal] Win32 DLL problem / VST audio plugin

2005-01-15 Thread chromdildo
Hi everybody,
I got a problem compiling a win32 DLLs with latest fpc/lazarus.
The DLL is a VST-Plugin, using the Delphi template from 
http://www.tobybear.de
exporting just one function main, working perfectly under Delphi.

The only thing I found on the net was:
http://www.nl.freepascal.org/lists/fpc-pascal/2002-January/002663.html
Three years old. And doesnt work.
I checked (MS DLL dependency walker) the linked DLL (extremely big: 4,5 
MB compared to same compiled under Delphi: 400kB) with correctly 
exported function main (only if *NOT* smart linkable -CX) and noticed 
a wrong Link checksum (compared to real checksum)

No need to mention: the linked DLL doesnt work under any host...
I think this got something to do with the right compiler switches for 
static/dynamic librarys... But no way...

AND PLEASE: Dont tell me to use the original Delphi, I know there are 
free PE versions ... I finally want it to compile on a MAC, too!
Please, if you got any suggestions...

Thanks for your reply. And best regards.
./chrom
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] USB or RS-232 capability?

2005-01-14 Thread chromdildo
Hi,
I am very interested in the libusb header translation, too.
Do you have a public server where to put the files?
I like to write a configuration utility for the Eumex 504PC SE/USB (ISDN 
/ PBX) in fpc/linux.

I try to implement the commands found at 
http://amor.rz.hu-berlin.de/~h0444er1/eutrace/
in a lightweight gtk+ interface, without the LAN / WAN features, just 
configuration.

Hopefully, the header files to libusb will help me a lot... and released 
to the public if it is successful.

best regards.
./chrom

Johann Glaser wrote:
Hi!
 

OK--that's helpful, guys. I'm still scratching my head on how to tackle 
this project. Thanks.
   

Did you hear of libusb http://libusb.sourceforge.net/? I used it for
several projects, some of which use FPC too. If you want to have my
header translation to an FPC unit just drop me an email. 

Bye
 Hansi
 


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