Posts: 24
Threads: 4
Joined: Sep 2004
Can someone tell me how to use libraries? I know what they are, and what they do, but have never used them in QB. (I want to use them in FB)
Also, how do I make my own libraries?
Posts: 140
Threads: 13
Joined: Apr 2005
Quote:Can someone tell me how to use libraries? I know what they are, and what they do, but have never used them in QB. (I want to use them in FB)
Also, how do I make my own libraries?
Hello Jeremy,
you need an include file *.bi to declare the function/subs
the sourcecode of the lib *.bas
mylib.bi
Code:
declare myfunc(byval parameter as integer) as integer
inclib "mylib"
mylib.bas
Code:
#include "mylib.bi"
myfunc(byval arg1 as integer) as integer
return arg1+1
end function
fbc -lib mylib.bas
Code:
'testmylib.bas
#include "mylib.bi"
print myfunc(1)
fbc testmylib.bas
testmylib
i wrote it online not tested but this is the way to build and use libs in FB.
take a look in the FreeBASIC/examples/lib folder.
Joshy
sorry about my english