Qbasicnews.com

Full Version: FB and how it knows what Lib to link to..
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
One thing i wanted to know about FB how does it know what lib to link to is there some tag in the .bi file's that say's link to this .a file ?

just interested becasue i might want to take a crack at translating a header file or two
Or you add to the include file the directive:

'$inclib: "libraryname"

Where libraryname is the name of the library file without the initial "lib" and without the extension ".dll.a" or just ".a".


You can also declare the lib on every function prototype like:

declare sub foo lib "somelibrary" alias "foo" ( ... )

Every external C function needs an alias, or the function's name will be uppercased. The alias is just the C original name.

If the proc was declared w/o modifiers in C (without __stdcall for example), then you must to add the CDECL to the declaration, see sdl.bi for the examples.

You can also add the library to FBC's cmm-line, using "-l libraryname" (w/o quotes).