Recent

Author Topic: Dll to .So  (Read 10030 times)

mauro.sano

  • Newbie
  • Posts: 2
Dll to .So
« on: July 21, 2006, 02:12:01 pm »
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

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Dll to .So
« Reply #1 on: July 21, 2006, 02:26:20 pm »
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.


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??


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?


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

  • Newbie
  • Posts: 2
Dll to .So
« Reply #2 on: July 21, 2006, 02:32:59 pm »
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

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Dll to .So
« Reply #3 on: July 21, 2006, 03:23:52 pm »
Quote from: "mauro.sano"
In Win32 in fullty working...now i´m in a project to convert to .so.


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

 

TinyPortal © 2005-2018