Importing Static Libraries

BlitzMax Forums/BlitzMax Programming/Importing Static Libraries

N(Posted 2005) [#1]
I was wondering if anyone can give me a basic run-down (or step-by-step tutorial or example) of how you import static libraries.

As far as I know, it works like this:

Import "-lfoobar"


Then you access the functions in it like this:
Extern
     Function foo:Int Ptr(bar:Byte Ptr)="__Z21foov"  ' return type and arguments are just there as an example
End Extern


Is there anything wrong with that? The documentation didn't help me much as it only covers importing a .C file, which isn't what I want to do.

Thanks in advance.


skn3(Posted 2005) [#2]
You can use a filename if needed
Import "mylib.a"


Also make sure the function defining uses the exact name, EG
__Myfunc@4 , or whatever it may be.