[fpc-pascal]Need help on LinkLib

Matt Emson memsom at interalpha.co.uk
Thu Dec 7 13:02:01 CET 2000

If it were Delphi code, I'd say you were missing the reference to the library
you were calling ibfind from (but then again I could be wrong)

You'd need to find something in Free Pascal that does the same as:

procedure DoSomething; external 'MYLIB.DLL'; 
{this is straight out of Delphi's help, so it's not linux geared}

Maybe (I am guessing here, so don't assume I know what I'm talking about)

Function ibfind(name : PChar) : LongInt; cdecl; external "gpiblib.a"; 
// or maybe
//Function ibfind(name : PChar) : LongInt; cdecl; external "gpiblib"; 

That would work in Object Pascal anyway.

Hope that helps,


>I want to Link a library to my program. I tried "{LinkLib gpiblib.a}".
>In this library it exists a function "int ibfind(char *name)".  Therefor
>i insert the following line into my interface section in my unit:
>"Function ibfind(name : PChar) : LongInt; cdecl; external".
>I tried to use it with "nr := ibfind(device);" where nr is a LongInt and
>device is PChar. When i try to run the program i get the following
>error: "Error: undefined reference to `ibfind' "
>What i am doing wrong? Could somebody help me?

More information about the fpc-pascal mailing list