Forum > Options

Dll to .So

(1/1)

mauro.sano:
Hi Fellows!

Nowadays, I have a Delphi project compiling to a .dll file, sure, using Windows 32 and now I have to do the same projecto compiled .so file.

Do you know if is it possible?

May I use the same .dpr to build a dll and .so??

Can I build the .so in enviroment Windows 32?


Sorry for many questions, but I´m a Larazus´ new user!


Thanks for all!

felipemdc:

--- Quote from: "mauro.sano" ---Nowadays, I have a Delphi project compiling to a .dll file, sure, using Windows 32 and now I have to do the same projecto compiled .so file.
--- End quote ---


A library should be really easy to convert, specially one that doesn´t use visually designed forms. On the tools menu there is a option to convert a Delphi project to a Lazarus project. Then add this compatibility code before the interface keyword on *every* unit you have:

{$ifdef fpc}
  {$mode delphi}{$h+}
{$endif}

This will make sure it compiles with both Delphi and Free Pascal. Then try to compile and fix the minor problems.

Please read this to understand the differences between lazarus and Delphi:

http://wiki.lazarus.freepascal.org/index.php/Lazarus_For_Delphi_Users

And use this as a reference in the conversion process:

http://wiki.lazarus.freepascal.org/index.php/Code_Conversion_Guide


--- Quote ---May I use the same .dpr to build a dll and .so??
--- End quote ---


Yes, but for lazarus the .dpr is just a normal source file. You to convert that to lazarus project, a .lpi file.


--- Quote ---Can I build the .so in enviroment Windows 32?
--- End quote ---


Yes, this is called cross compiling. The setup process is somewhat complex, and is explained here:

http://wiki.lazarus.freepascal.org/index.php/Cross_compiling#From_Windows

Since you will have to test you library anyway, it may be faster to just get it working on Windows, and the recompile on Linux.

mauro.sano:
Sekel,
thanks for the hints!!!

In Win32 in fullty working...now i´m in a project to convert to .so.

I started to the convertion using C and GCC.


I´ll try to do this!!!


Thanks for all!

Mauro Sano

felipemdc:

--- Quote from: "mauro.sano" ---In Win32 in fullty working...now i´m in a project to convert to .so.
--- End quote ---


If you have access to a machine with Linux, all you have to do is open the project on Lazarus and recompile it. That will generate a .so instead of a .dll

Navigation

[0] Message Index

Go to full version