Please explain how to package everything needed to compile and run an executable
I can't seem to find anywhere online that explains it to me in stupid enough terms for me to accomplish this.
How do I make sure all the necessary files are there when I run an executable after compilation?
For this specific program, it's a simple linked list I'm trying to learn to build using a modular strategy. But people have portable programs that are much more complex than the grade school program I've created. So, I'm trying to figure out how to have the necessary files to run the executable like a portable program, but I'm not really sure how that is supposed to be accomplished.
Is it a command option I'm supposed to be using with the compiler, code that I'm supposed to be adding in the source files telling the program the path and files to access, or is it something that I manually package into the executable like I would a zip file, and then somehow make that executable extract those necessary files to the folder when the executable is run?
I've been using g++ from the portable versions recommended on the MSYS website to compile a header file, a .cpp definitions file, and a main.cpp file from the Windows command prompt. The executable runs fine IF I have the bin folder listed in PATH, or if I run the executable inside that bin folder.
But if I remove that folder from my PATH and don't run the executable inside the bin folder, then it gives me an error saying it needs two dll files. How do I provide these two files, as well as any other files needed, to my executable to make it like a portable program? Obviously, not everyone is going to have a folder with these apparently necessary files.