#COMPILE Directive
Syntax:
#COMPILE EXE ["filename"]#COMPILE DLL ["filename"]
Description
The #COMPILE directive specifies the output target type for the compilation. It must appear before any executable code in the source file. PBXA64 supports two target types:
- EXE — Produces a standalone Windows executable (.exe). Optionally accepts a quoted output filename.
- DLL — Produces a Windows dynamic link library (.dll). Optionally accepts a quoted output filename.
If no filename is specified, the output file takes the name of the source file with the appropriate extension.
Parameters
| Parameter | Description |
|---|---|
"filename" | Optional. Specifies the output filename enclosed in double quotes. Must include the appropriate extension (.exe or .dll). If omitted, the source filename is used. |
Example
' Compile as console executable with custom name
#COMPILE EXE "MyApp.exe"
FUNCTION PBMAIN() AS LONG
PRINT "Hello from PBXA64!"
FUNCTION = 0
END FUNCTION
Notes
- The
#COMPILEdirective must be placed near the top of the source file, before anyFUNCTION,SUB, or executable statements. - Only one
#COMPILEdirective is allowed per source file. - When compiling a DLL, exported functions should use the
EXPORTmodifier. #COMPILEselects EXE or DLL output. The command-line option--target=win32selects x86/i686 PE32;--target=win64selects x64 PE32+.- PBXA64 does not support
#COMPILE SLLor legacy 16-bit targets.