Skip to content

Instantly share code, notes, and snippets.

@SolomonSklash
Last active July 23, 2021 22:49
Show Gist options
  • Save SolomonSklash/e267247e0006ebce999ea2c8a347bbb1 to your computer and use it in GitHub Desktop.
Save SolomonSklash/e267247e0006ebce999ea2c8a347bbb1 to your computer and use it in GitHub Desktop.
Creating a COFF object file from a resource script file on WIndows.
@echo off
:: This batch script should be run from a VS developer prompt.
:: rc will create a binary .res file
rc Resource.rc
:: cvtres will convert the .res file to a COFF object file
cvtres /MACHINE:x64 /OUT:Resource.o Resource.res
:: The object file can be included during compilation like so:
:: cl.exe main.cpp /link /OUT:main.exe /SUBSYSTEM:CONSOLE /MACHINE:x64 Resource.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment