Skip to content

Conversation

@tobil4sk
Copy link
Member

@tobil4sk tobil4sk commented Jan 3, 2026

Currently, the toolchain just passes the .rc file to the c++ compiler which results in the following warning:

 - Running command: x86_64-w64-mingw32-g++ -c -Wno-overflow -g -O2 -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS -DHX_SMART_STRINGS -DHXCPP_API_LEVEL=430 -DHX_WINDOWS -m64 -DHXCPP_M64 -I/.../hxcpp/include ./ApplicationMain.rc -o/.../HelloWorld/Export/windows/obj/obj/mingw64-nc/20eab515_ApplicationMain.o
x86_64-w64-mingw32-g++: warning: ./ApplicationMain.rc: linker input file unused because linking not done

This means no object file is generated for the .rc, so this is followed by an error during link time:

 - Link: ApplicationMain.exe: x86_64-w64-mingw32-g++ -o ApplicationMain.exe -Wl,--enable-auto-import -mwindows -m64 -L/usr/x86_64-w64-mingw32/lib/libs @obj/mingw64-nc/all_objs -lws2_32
/usr/lib/gcc/x86_64-w64-mingw32/15.2.0/../../../../x86_64-w64-mingw32/bin/ld: cannot find obj/mingw64-nc/20eab515_ApplicationMain.o: No such file or directory
collect2: error: ld returned 1 exit status
Error: Error while running command
x86_64-w64-mingw32-g++ -o ApplicationMain.exe -Wl,--enable-auto-import -mwindows -m64 -L/usr/x86_64-w64-mingw32/lib/libs @obj/mingw64-nc/all_objs -lws2_32

windres is a utility that's part of mingw for processing .rc files, so that should be used here. We want to generate .o files instead of .res files like with msvc, since mingw cannot process .res files.

With this patch it is possible to build a haxe app using -D resourceFile=ApplicationMain.rc without linking errors. It is possible to verify that the resource has been added correctly, for example if the company name has been set:

exiftool bin/HelloWorld.exe | grep -i company

@tobil4sk tobil4sk changed the title Fix mingw toolchain rc file handling [tools] Fix mingw toolchain rc file handling Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant