An open API service indexing awesome lists of open source software.

https://github.com/warmist/file_to_obj

Converts any file to linkable x64 obj file for msvc. This way you don't need to compile C file (e.g. from xd) and you dont need to mess with resource files etc...
https://github.com/warmist/file_to_obj

linking msvc programming utility

Last synced: 4 months ago
JSON representation

Converts any file to linkable x64 obj file for msvc. This way you don't need to compile C file (e.g. from xd) and you dont need to mess with resource files etc...

Awesome Lists containing this project

README

          

# file_to_obj
Converts any file to linkable x64 obj file for msvc. This way you don't need to compile C file (e.g. from xd) and you dont need to mess with resource files etc...

# Usage

For use with cmake:
* Put the included (in assets dir) `EmbedFileFTO.cmake` into your `CMAKE_MODULE_PATH`
* `include("cmake/EmbedFileFTO.cmake")` somewhere in your `cmakelists.txt`
* `embed_file( )`
* add to `add_executable(...)` optionaly: `${EMBEDDED_HDRS}` and mandatory: `${EMBEDDED_LIBS}`
* `include_directories(${PROJECT_BINARY_DIR})` because i forget if it already looks for headers there?
* in your cpp file `#include ".hpp"` and it will contain: `EMB_FILE_` and `EMB_FILE_SIZE_`
* Have fun!

# WHY?

Not sure... Probably sanity is getting low... And i liked the `ld` having that power and basically alternatives: [here](https://stackoverflow.com/questions/4864866/c-c-with-gcc-statically-add-resource-files-to-executable-library)

# Resources

* https://docs.microsoft.com/en-us/windows/desktop/Debug/pe-format
* http://www.delorie.com/djgpp/doc/coff/
* https://www.agner.org/optimize/calling_conventions.pdf