[fpc-pascal] Linking issue in Ubuntu 9.04 (32 bit)

Alan Krause alank at shermanloan.com
Fri Apr 24 22:39:00 CEST 2009


I've installed ubuntu 9.04 in a VM to test it out, and have installed fpc
2.2.4. It is always good to look before you leap, right?

Anyhow, I am trying to compile an existing project that works fine under
Ubuntu 8.04. I can get all of the unit to compile, but when it comes time to
link them together into a shared library, I get the following:

Linking libproj.so
Error: Can't call the linker, switching to external linking
Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you did
not specify a source file to be compiled)

Here is the source code for the sample project:

library project1;

uses
 Classes;

function dRound(iDec: integer; dRate: double): double;
const
 TenToPower: Array[0..9] of integer = (1, 10, 100, 1000, 10000, 100000,
                                       1000000, 10000000, 100000000,
1000000000);
var
 dInc : double;
begin
 if iDec > 0 then begin
    dInc := 0.5000001;
    result := trunc (dRate * (TenToPower [iDec]) + dInc) /
       TenToPower [iDec];
 end else begin
    result := dRate;
 end ;
end;

function one : double; cdecl;
begin
 Result := dRound( 2, 0.529 ) ;
end;

begin
end.

And the command I use to compile it is:
fpc -Sd -Cg -O3 proj.pas

Anyone else having similar issues?

Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20090424/9518a240/attachment.html>


More information about the fpc-pascal mailing list