Package: fp-compiler
Version: 2.2.0-dfsg1-5

--- Please enter the report below this line. ---
Using FPC 2.2.0, it is possible, but still tricky to create a DLL executable. 
This will be fixed in next releases hopefully.
Here is a brief example showing how to create a DLL executable. You can either 
change your make files or wait for -XD to be fixed. This is planned for future 
releases, but may take time.
[EMAIL PROTECTED]:tmp]$fpc -XD -Cn dynprog
Hint: End of reading config file /home/mazen/.fpc.cfg
Free Pascal Compiler version 2.2.0 [2008/03/16] for i386
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Linux for i386
Compiling dynprog.pas
Compiling dynlib.pas
Closing script ppas.sh
21 lines compiled, 0.1 sec
2 hint(s) issued
[EMAIL PROTECTED]:tmp]$ppumove dynlib
PPU-Mover Version 2.1.1
Copyright (c) 1998-2007 by the Free Pascal Development Team

Processing dynlib.ppu... Done.
Linking dynlib.o
Done.
[EMAIL PROTECTED]:tmp]$fpc -XD dynprog.pas 
Hint: End of reading config file /home/mazen/.fpc.cfg
Free Pascal Compiler version 2.2.0 [2008/03/16] for i386
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Linux for i386
Compiling dynprog.pas
Linking dynprog
5 lines compiled, 0.2 sec
2 hint(s) issued
[EMAIL PROTECTED]:tmp]$file dynprog
dynprog: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically 
linked (uses shared libs), stripped
[EMAIL PROTECTED]:tmp]$./dynprog 
./dynprog: error while loading shared libraries: libdynlib.so: cannot open 
shared object file: No such file or directory
[EMAIL PROTECTED]:tmp]$LD_LIBRARY_PATH=$PWD ./dynprog 
Hello from DynFunc
[EMAIL PROTECTED]:tmp]$

--- System information. ---
Architecture: i386
Kernel:       Linux 2.6.24-1-686

Debian Release: lenny/sid
  500 unstable        ftp.fr.debian.org 

--- Package information. ---
Depends                  (Version) | Installed
==================================-+-==================
fp-units-rtl     (= 2.2.0-dfsg1-5) | 2.2.0-dfsg1-5

unit dynlib;
interface
procedure DynFunc;

implementation

procedure DynFunc;
begin
  WriteLn('Hello from DynFunc');
end;

initialization

finalization

end.
program dynprog;
uses dynlib;
begin
  DynFunc;
end.

Reply via email to