$LIBRARY directive
Purpose: The library named as a parameter in a $LIBRARY statement will be linked to the program without the need, at link time, to specify explicitly, on the command line or in a makefile, the library.
$LIBRARY is an alias to the C compiler "#pragma lib" feature. $LIBRARY operates on the same level as #INCLUDE and will emit the appropriate library statements within the header section of the emitted C source code.
Syntax 1: $LIBRARY "c:\bcx\lib\mylib.lib" Parameters:
|
Syntax 2: $LIBRARY "mylib.lib" Parameters:
|
Syntax 3:
$LIBRARY <mylib.lib>
Parameters:
|
Example:
$LIBRARY<shell32.lib>'-------------------------------------------------' BrowseFolder' Original by Jacob Navia' Converted to BCX version by Kevin Diggins'-------------------------------------------------DIMFolder$IFBrowseDir("Choose a folder", Folder$)THEN"Chosen Folder: ", Folder$ELSE"Action Cancelled"ENDIFFUNCTIONBrowseDir(Title$, Result$)'---------------------------------------LOCALpMallocASLPMALLOCLOCALbrowseInfoASBROWSEINFOLOCALlpItemIDListASLPITEMIDLISTLOCALRc'---------------------------------------CONSTBIF_NEWDIALOGSTYLE=64'---------------------------------------IFS_OK <> SHGetMalloc(&pMalloc)THENEXITFUNCTIONmemset(&browseInfo,0,SIZEOF(BROWSEINFO))browseInfo.hwndOwner=GetActiveWindow()browseInfo.pszDisplayName=Result$ browseInfo.lpszTitle=Title$ browseInfo.ulFlags=BIF_NEWDIALOGSTYLE lpItemIDList=SHBrowseForFolder(&browseInfo)IFlpItemIDList <> NULLTHENResult$=""IFSHGetPathFromIDList(lpItemIDList,Result$)THENIFLEN(Result$)>0THENRc=1ENDIFpMalloc->lpVtbl->FREE(pMalloc,lpItemIDList)ENDIFpMalloc->lpVtbl->Release(pMalloc)' BCX is amazing !FUNCTION=RcENDFUNCTION
BCX Console Sample Programs using $LIBRARY directive.
S66.bas S73.bas S92.bas S126.bas S128.bas
$NOLIBRARY directive
Purpose: The library named as a parameter with a $NOLIBRARY directive will not be linked to the program. This directive is used with the libraries that BCX loads by default when the $CPP directive or the bc.exe -c command line flag is used.
Syntax: $NOLIBRARY "LibraryName.lib" Parameters:
|