Skip to content

Instantly share code, notes, and snippets.

@SolomonSklash
Created July 23, 2021 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SolomonSklash/31b8acb1b07a13a19bd66b9db3313f4f to your computer and use it in GitHub Desktop.
Save SolomonSklash/31b8acb1b07a13a19bd66b9db3313f4f to your computer and use it in GitHub Desktop.
Creating a COFF object file from a resource script file on Linux.
#!/bin/bash
# This script needs mingw installed
# Convert a .rc resource script input file to a .res binary resource output file
x86_64-w64-mingw32-windres -J rc -i Resource.rc -O res -o Resource.res
# Convert a .res binary resource input file to a COFF object output file
x86_64-w64-mingw32-windres -J res -i Resource.res -O coff -o Resource.o
# The object file can be included during compilation like so:
# x86_64-w64-mingw32-g++ main.cpp --static -o main.exe Resource.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment