PlanetSquires Forums

Support Forums => Tiko Programming Language => Topic started by: Vortex on November 26, 2026, 05:32:35 AM

Title: Compiling resource scripts
Post by: Vortex on November 26, 2026, 05:32:35 AM
Hello,

How to compile resource scripts with the Tiko compiler?

My resource file rsrc.rc :

#include <windows.h>
#include <commctrl.h>

LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US

1000 DIALOGEX DISCARDABLE 200, 200, 208, 96
STYLE WS_THICKFRAME|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_VISIBLE
CAPTION "LoadImageFromFile demo"
FONT 8, "MS Sans Serif", 0, 0, 1
{
}

D:\tiko-lang>tiko Test.bas Rsrc.rc -o Test.exe
Rsrc.rc:1:10: fatal error: 'windows.h' file not found
    1 | #include <windows.h>
      |          ^~~~~~~~~~~
1 error generated.
llvm-rc: Preprocessing failed.
tiko-lang: error TKO0110: compiling resource 'Rsrc.rc' failed (exit 1)
Title: Re: Compiling resource scripts
Post by: Johan Klassen on November 26, 2026, 06:50:48 AM
Hi Vortex
for *.h files use #cinclude
Title: Re: Compiling resource scripts
Post by: Vortex on November 26, 2026, 07:02:05 AM
Hi Johan,

Thanks but #cinclude didn't work :

D:\tiko-lang>tiko -Wl /OPT:ICF DlgBox.bas Rsrc.rc -o DlgBox.exe
Rsrc.rc:1:2: error: invalid preprocessing directive
    1 | #cinclude <windows.h>
      |  ^
Rsrc.rc:2:2: error: invalid preprocessing directive
    2 | #cinclude <commctrl.h>
      |  ^
2 errors generated.
llvm-rc: Preprocessing failed.
tiko-lang: error TKO0110: compiling resource 'Rsrc.rc' failed (exit 1)
Title: Re: Compiling resource scripts
Post by: Paul Squires on November 26, 2026, 08:48:02 AM
Good question. I thought the error was simply because the includes were enclosed in angle brackets rather than double quotes. Turns out there is more to it than that. tiko uses llvm-rc whereas FBC uses GoRC and FBC also passes path information to GoRC so that it can locate FBC's own include files. tiko is not passing the include path locations to llvm-rc so llvm-rc will then look on the machine for an installed SDK that may have the files. If not found, well, there's your error.

A second, more minor problem, the bundled fbc headers don't define LANG_ENGLISH or SUBLANG_ENGLISH_US, because GoRC knew those names itself. So pointing llvm-rc at them still fails, on the LANGUAGE line. That one is easy to fix.

I will fix both of these issues and have it in the next tiko release which should go out today.
 
Title: Re: Compiling resource scripts
Post by: Vortex on November 27, 2026, 05:05:21 AM
Hi Paul,

Thanks for the new release fixing the issue :

D:\tiko-lang>tiko DlgBox.bas Rsrc.rc -o DlgBox.exe -s gui

D:\tiko-lang>tiko --version
tiko 0.1.8
target windows-x86_64

The resource script :

#include <windows.h>
#include <commctrl.h>

1000 DIALOGEX DISCARDABLE 200, 200, 208, 96
STYLE WS_THICKFRAME | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_VISIBLE
CAPTION "LoadImageFromFile demo"
FONT 8, "MS Sans Serif", 0, 0, 1
BEGIN
END