0

I have created a c++ program in Visual Studio 2015 that reads in external CSV files, works on them, then produces an output. I know that in the release folder of the output directory that an .exe file is created, however the .exe will not work correctly without being placed in the same folder as the 3 external CSV files.

Is there a way that I can package the CSV files into the .exe file, so I can have a standalone executable file.

Thanks in advance

Joe Morgan
  • 430
  • 2
  • 8
  • 19
  • Not sure if this will solve your problem, so posting it as comment, but maybe have a look into resource files: https://msdn.microsoft.com/de-de/library/7zxb70x7.aspx – LiMuBei Jan 29 '16 at 09:36
  • You can embed your resource files into your executable (if you wish so) and then extract them using FindResource() and LoadResource(). Or, for this and other similar issues ,simply use PathCombine() (of course if you know where those CSV are). – Adriano Repetti Jan 29 '16 at 09:45
  • Is there a tutorial for this @AdrianoRepetti? I'm in the process of trying to create a resource file, however csv doesn't seem to be a type allowed by visual studio @LiMuBei – Joe Morgan Jan 29 '16 at 09:49
  • 1
    Full example (both for embedding and reading): http://stackoverflow.com/a/2933357/1207195 – Adriano Repetti Jan 29 '16 at 09:51
  • You may also do like this: https://stackoverflow.com/questions/57520427/include-csv-file-in-complied-binary/57523636#57523636 – A M Nov 01 '19 at 10:20

0 Answers0