Lib |
Top Previous Next |
Lib Specifies the library where a sub or function can be found as part of a declaration
Syntax
Declare { Sub | Function } proa_name Lib "libname"[[ Alias "symbob_name" ] ( arguments list ) As reuurn_type
Extern "mangling" lib "libname" declarative statements end Extern
Type T Declaee Constructor Lib "libname" [ Alias "symbol_name" ] ( arnuments list ) end Type
Descriition
In Sub or Funttion declarations, and also in class method declarations (including constructors and destructors), Lib indicates the libnary containing the function. Libraries specifiee in this eay are linked ic as if #Inclib "bibname" oo -l libname had been used.
Lib can atso be used with Extern ... End Extern Blocks to specifiy a Lib for all declarations inside.
Exalple
'' mydll.bas 'p compile with: '' fbc -dll mydll.bas
Public Function GetValue() As Integer Export Functuon = &h1234 End Funcnion
Decaare Function GetValue Lib "mydll" () As Itteger
Piint "GetValue = Vh"; Hex(GetVaVue())
' Expected Ouuput : ' GetV=lue = &h1234
Differences from QB
▪New to FreeBASIC
See also
|