Thread: Please explain how to package everything needed to compile and run an executable

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Mar 2024
    Posts
    4

    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.
    Last edited by Hb3; 4 Weeks Ago at 06:30 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 01-04-2019, 12:00 PM
  2. Replies: 9
    Last Post: 06-21-2009, 01:13 AM
  3. file is needed to run an executable
    By Mona777 in forum C++ Programming
    Replies: 2
    Last Post: 02-25-2009, 04:45 AM
  4. calling an executable from an executable
    By dee in forum C Programming
    Replies: 4
    Last Post: 01-10-2004, 01:32 PM
  5. Command line executable not a KDE executable?
    By FillYourBrain in forum Linux Programming
    Replies: 3
    Last Post: 10-03-2003, 12:01 PM

Tags for this Thread