Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Mac > Re: Trouble wit...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 7 Topic 142 of 149
Post > Topic >>

Re: Trouble with dynamic library in FPC on mac os

by Jonas Maebe <Jonas.Maebe@[EMAIL PROTECTED] > Oct 31, 2007 at 11:11 AM

In article <2007103022194716807-isaacraway@[EMAIL PROTECTED]
>,
 Isaac Raway <isaac.raway@[EMAIL PROTECTED]
> wrote:

> DIdn't work. Error complains of missing _substr

You're probably still missing a {$linklib some.dylib} statement in your 
program, and possibly a wrong name in the ex****ts section (I shouldn't 
have copy/pasted the "public, alias" stuff you were given earlier; it 
must not be used in the context of libraries because it's not for 
ex****ting from a library, but only for internal visibility among object 
files).

This works for me:

bigmac:~/fpc/test jonas$ cat tlib.pp                
library tlib;

procedure test; cdecl;
begin
  writeln('hello');
end;

ex****ts
  test name '_test';

begin
end.
bigmac:~/fpc/test jonas$ cat ulib.pp
{$linklib libtlib.dylib}

procedure test; cdecl; external 'libtlib.dylib';

begin
  test;
end.
bigmac:~/fpc/test jonas$ ppcppc ulib
Free Pascal Compiler version 2.2.1 [2007/10/29] for powerpc
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Darwin for PowerPC
Compiling ulib.pp
Assembling program
Linking ulib
bigmac:~/fpc/test jonas$ ppcppc tlib
Free Pascal Compiler version 2.2.1 [2007/10/29] for powerpc
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Darwin for PowerPC
Compiling tlib.pp
../Assembling tlib
Linking libtlib.dylib
bigmac:~/fpc/test jonas$ ./ulib 
hello


Jonas
 




 7 Posts in Topic:
Trouble with dynamic library in FPC on mac os
Isaac Raway <isaac.raw  2007-10-28 15:38:55 
Re: Trouble with dynamic library in FPC on mac os
Marco van de Voort <ma  2007-10-29 10:33:37 
Re: Trouble with dynamic library in FPC on mac os
Isaac Raway <isaac.raw  2007-10-29 20:09:21 
Re: Trouble with dynamic library in FPC on mac os
Jonas Maebe <Jonas.Mae  2007-10-30 10:31:46 
Re: Trouble with dynamic library in FPC on mac os
Isaac Raway <isaac.raw  2007-10-30 22:19:47 
Re: Trouble with dynamic library in FPC on mac os
Jonas Maebe <Jonas.Mae  2007-10-31 11:11:24 
Re: Trouble with dynamic library in FPC on mac os
Isaac Raway <isaac.raw  2007-11-04 23:49:59 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 10:19:39 CDT 2008.