PBXB64 Resource Compiler
Resource Compiler
Standard
Full Windows resource support with the #RESOURCE directive. Compile .rc files to .res and link them into executables. Fixed null-terminated path parsing and empty-include windres crash. Full regression test: test_resource.pb.
#RESOURCE Directive
Resource compilation in PB
' In your .pb source file:
#RESOURCE "myapp.rc"
FUNCTION PBMAIN() AS LONG
' The .rc file is compiled to .res and linked
' automatically during the build
FUNCTION = 0
END FUNCTION
The #RESOURCE directive tells PBXB64 to compile the specified .rc file to .res and link it into the final executable. The compiler handles the full .rc -> .res pipeline internally.
.RC File Example
Windows resource script
// myapp.rc
#include "windows.h"
APP_ICON ICON "app.ico"
IDD_DIALOG DIALOG 0, 0, 200, 100
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
CAPTION "My Dialog"
BEGIN
DEFPUSHBUTTON "OK", IDOK, 10, 70, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 130, 70, 50, 14
END
STRINGTABLE
BEGIN
IDS_HELLO "Hello from resources"
END
VERSIONINFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileDescription", "My Application"
VALUE "FileVersion", "1.0.0.0"
END
END
END
Standard Windows .rc syntax: icons, dialogs, string tables, version info, menus, and bitmaps. The compiler uses windres to compile .rc to .res, then links the .res into the PE executable.
CLI - Resource Compilation
Compile with resources
REM Compile PB with .rc file
PBXB64 myapp.pb -o myapp.exe
REM The compiler automatically:
REM 1. Finds #RESOURCE "myapp.rc"
REM 2. Compiles myapp.rc to myapp.res via windres
REM 3. Links myapp.res into the final .exe
REM Check resources are embedded
PBXB64 myapp.pb -o myapp.exe --verbose
The .rc -> .res pipeline is fully automatic. The compiler detects #RESOURCE directives, invokes windres with proper null-terminated path handling, and links the resulting .res into the PE32+ executable.
PBXB64 is part of the PBX-Compiler package. Free for private use, cleanly licensed for business.