PDA

View Full Version : Compiling delphi style console applications with freepascal



noeska
05-11-2004, 03:55 PM
I installed fpc for linux today (until now i use kylix2pro and delphi5), but i do seem to be able to compile delphi stile applications with it. For example i use:

var
varname: type = 1;

Could someone give me a quick boost into fpc compiling delphi style applications?

Also i get a complaint about linking ld-linux.so? I do not know why it is needed. The lib is available though.

{MSX}
05-11-2004, 04:20 PM
Could someone give me a quick boost into fpc compiling delphi style applications?


Ok, but you give us too few information..
what command line you used to compile ?
what's the exact error(s) ?
what's the problem with ld ?
what kind of library are you using ?

noeska
05-11-2004, 04:31 PM
i use fpc-1.0.10

i cannot reproduce the exact error message as i am now back under windows.

i used fpc -Sd -S2 hello.pas to compile

what i am trying to accomplish is to compile the openal unit from my openal site. And then some tutorials.

the ld error is that is says the lib cannot be found, but it does exist.

{MSX}
05-11-2004, 06:03 PM
i use fpc-1.0.10

i cannot reproduce the exact error message as i am now back under windows.

i used fpc -Sd -S2 hello.pas to compile

what i am trying to accomplish is to compile the openal unit from my openal site. And then some tutorials.

the ld error is that is says the lib cannot be found, but it does exist.

Well i use the 1.9.2 version. It has the -MDelphi option for compatibility.
That's my compile script:

fpc -O2 -MDelphi -Fu"../generic" -Fu"../../JEDI-SDLv1.0/ode/Pas" -Fu"../odeutils" -Fu"../OpenGlLoop" -Fu"../../JEDI-SDLv1.0/SDL/Pas" -Fu"../../JEDI-SDLv1.0/OpenGL/Pas" -Fu"../../JEDI-SDLv1.0/SDL_Image/Pas" -Fi"../../JEDI-SDLv1.0/SDL/Pas" ode.dpr

For the lib, is it in the current dir or under /usr/lib/ ? If it's not there, copy it or make a link.

Bye!

noeska
05-11-2004, 07:15 PM
I downloaded fpc 1.94 and now things compile better.
Also i installed glib-devel now i do not have the ld linking error anymore.

New is that on executing ld is complaining about pointers not being valid anymore and refers to some c code?

{MSX}
05-11-2004, 07:36 PM
New is that on executing ld is complaining about pointers not being valid anymore and refers to some c code?

Can you post the exact output ?

Anonymous
07-11-2004, 10:48 AM
here is the exact output:
Inconsistency detected by ld.so: dl-minimal.c: 134: realloc: Assertion `ptr == alloc_last_block' failed!

noeska
07-11-2004, 01:19 PM
Phew i got all to work by adding {$LinkLib c}.

A new kylix and fpc example is available for download with tutorial #13 on http://www.noeska.com/doal .

Anonymous
05-01-2005, 12:20 AM
-Sd -S2 is probablly confusing it you should just use -Sd

delphi support is rather buggy in 1.0.10 though especially the method pointer support,