Including files into an executable at compile/link time

  • Thread starter Thread starter mezarashi
  • Start date Start date
  • Tags Tags
    files Time
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
Messages
652
Reaction score
0
I have a program that opens a very large .txt data file. This data file remains unchanged, but is always required to run the program. What I want to do is include this .txt into the .exe so that when I distribute the program I don't need to distribute two files, but only one instead.

I'm using Visual C++ with MS Visual Studio 2005. I've played around with some of the resources, but to no avail. I tried adding it as an HTML resource and then loading the resource, but the pointer to this resource apparently is invalid whether I treat it as a string of character bytes or as a file pointer.

Any ideas? Thanks in advance.
 
Physics news on Phys.org