?
Solved

Compile Delphi-written program with FPC

Posted on 2008-10-20
17
Medium Priority
?
1,625 Views
Last Modified: 2013-12-13
When compiling a Delphi written program with FPC, some incompatibilities occur. The question is how to deal with these incompatibilities. Delphi has a large amount of pre-installed units to be used, as does FPC. For example: the unit 'Math' is used by both compilers but there are many other units that are not compatible.

I have two questions concerning the units depicted below:
1. Is there a way to make Delphi units compatible with FPC?
2. If not, are there any equivalent units that do the same and can be used in FPC?

The following units in my Delphi program are not compatible with FPC:
- Comobj,
-  Windows,
-  ShellAPI,
-  ActiveX,
-  Forms,
-  FileCtrl
0
Comment
Question by:EXF_Pilatus
14 Comments
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 22765102
this may sound stupid, but what is fpc ?
0
 
LVL 7

Accepted Solution

by:
Cedric_D earned 1500 total points
ID: 22765790
- Comobj,
-  Windows,
-  ShellAPI,
-  ActiveX,
-  Forms,
-  FileCtrl

all these has one in common - they are platform-specific.
However, did you try compile of command-line application with FPC, using these units?
0
 

Author Comment

by:EXF_Pilatus
ID: 22766667
Thanks for your reply,

To Geert: FPC is Free Pascal Compiler

To Cedric:
- Comobj,
-  Windows,
-  ShellAPI,
-  ActiveX,
-  Forms,
-  FileCtrl
It appears indeed that these units are platform specific: they are accepted when used in Delphi on a windows platform and they are not accepted when used with FPC on our Linux cluster computer.  

Does anyone know if there are units for FPC that do exactly the same as the units, depicted above, used in Delphi?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 22767271
Have you seen the Lazarus Project ?

http://wiki.lazarus.freepascal.org

Are you trying to port a Delphi Windows application to Linux ?
I can't help there yet, just installed Ubuntu this weekend and
now looking to install a Delphi version, so i'm new too on this path.
0
 

Author Comment

by:EXF_Pilatus
ID: 22767872
No, we are trying to port a Delphi console application to run it in Linux. Any experience in that?
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 22767889
it won't work.
I had that experience ...

What does the console do ?

Maybe you can delete the units mentioned ...

A console application using Forms ?
0
 
LVL 6

Expert Comment

by:JosephGlosz
ID: 22770733
I looked into converting some of our projects from Delphi 6 to FPC, Dev-Pascal, and Lazarus.  If you have forms and visual components, give up all hope. I even tried to convert just a DLL even that was wracked with hundreds and hundreds of syntax errors. It was big complex DLL, but just a DLL nonetheless. No forms or visual components at all. I gave up.

In my opinion, you need to start from scratch in developing in these other pascals. It's less work than "converting."
0
 

Author Comment

by:EXF_Pilatus
ID: 22773918
Thanks for your comments.

I tried to delete some of the units and at a first glance, it appeared that the following units are not needed by the program I use:
-  Comobj,
-  Windows,
-  ShellAPI,
-  ActiveX,
-  Forms,
So quite alot! Should have known this before posting this question. Nonetheless, FileCtrl is needed:
-  FileCtrl
Does there exist any replacement in FPC (or Lazarus) for this unit?

I'm probably looking at the tip of the iceberg concerning all the (syntax)errors FPC will give me but it is to much work though to rewrite my 200 page program...
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 22773932
There is just maybe the chance you are using the function SelectDirectory ???

Look at the help function for SelectDirectory
there are 2 possibilities ...
don't use it or add QDialogs
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 22773940
In the project options check the Warnings and Hints
and specifically look at the Warnings for platform specific

if you resolve all these platform specific (windows) issues, it should work
0
 

Author Comment

by:EXF_Pilatus
ID: 22794165
Thanks for your answers. I managed to compile the program in FPC, not using any of the previous mentioned units. I had to add some other units though:
- Classes
and
- Process

It works now!
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 22819804
please clarify why you gave a C ?
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 22820862
i would be happy to accept a reason why a C grade was given
and have the opportunity to act on that reason
0
 

Author Comment

by:EXF_Pilatus
ID: 22821576
I don't use this site to waste time discussing the marks for answers. To keep it short: I gave a C because none of the above comments, neither yours, gave a satisfying answer to my question. Cedric D helped me the most.

I appreciate it that you're trying to help me though.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Eseutil Hard Recovery is part of exchange tool and ensures Exchange mailbox data recovery when mailbox gets corrupt due to some problem on Exchange server.
There are literally thousands of Exchange recovery applications out there. So how do you end up picking one that’s ideal for your business & purpose? By carefully scouting the product’s features, the benefits it offers you, & reading ample reviews f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question