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)
Hi Vortex
for *.h files use #cinclude
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)
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.
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