Embedding resources in executable using GCC

前端 未结 4 1723
小鲜肉
小鲜肉 2020-11-22 16:21

I\'m looking for a way to easily embed any external binary data in a C/C++ application compiled by GCC.

A good example of what I\'d like to do is handling shader cod

4条回答
  •  青春惊慌失措
    2020-11-22 17:04

    As well as the suggestions already mentioned, under linux you can use the hex dump tool xxd, which has a feature to generate a C header file:

    xxd -i mybinary > myheader.h
    

提交回复
热议问题