#compile time file reading

1 messages · Page 1 of 1 (latest)

hybrid anchor
#

Is there a way I can read files at compile time? AFAIK it's not possible to do using stl, but maybe there is a slightly esoteric way of doing this? Thanks

tender ermineBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

cyan steeple
#

You cannot read a file at compile time

#

C23 got #embed, C++26 will probably get it

#

You can hack your own #embed with python in many cases

sterile cipher
#

If you make the file you want to read into parseable cpp code (ie a const global array or something) you can #include it 😉

short pecan
cyan steeple
#

That's cool, it'll get the binary data in at link time. Unfortunately won't get the binary data in at compile time if that's a strict requirement.

hybrid anchor
#

Good to know, thanks! I'll leave this question opened for a bit longer in case something pops up

tender ermineBOT
#

@hybrid anchor Has your question been resolved? If so, run !solved :)

tender ermineBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.

hybrid anchor
#

!solved