thank you for the help, but it does not work !

I have tried for many hours, but nothing works. 

I have also tried dynamic loading and it failed as well. It finds the
library but not the function.

(In a lazarus project, the function works very well however) 

It looks like it finds the library, but the function is not inside ?

I assume I should link to /lib/libc.so or /lib/tls/libc.so .

Strange. Help please.

my program looks like this:

program testj0;

{$mode objfpc}{$H+} // the standard stuff that comes when you 
                    // open a project

uses
 cthread, classes ; // the standard stuff that comes when you 
                    // open a project

var 
a,b : doublle;

function j0(x:double):double;cdecl;external 'c'; 

begin
a := 1.2;
b := j0(a);
end.
  
I have tried the lines below also but got the same answer. 

Alain

On Tue, 2006-08-22 at 13:08 +0200, Marco van de Voort wrote:
> On Mon, Aug 21, 2006 at 07:20:21PM +0200, Mattias Gaertner wrote:
> > > An custom program doesn't link to c.
> > 
> > You can add 
> > {$linklib c}
> 
> but you _should_
> 
> Uses InitC;
> 
> and define the function as
> 
>   function j0(x:double):double;cdecl;external clib;
> 
> which abstracts the name of libc and takes care of possible dependancies of
> libc.
> 
> _________________________________________________________________
>      To unsubscribe: mail [EMAIL PROTECTED] with
>                 "unsubscribe" as the Subject
>    archives at http://www.lazarus.freepascal.org/mailarchives

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to