Wednesday, 15 May 2013

Creating a bash script to compile a c++ -


I have a program that I've written in C ++, which shows some simulation results in .csv Excel file .

According to some instructions, I need to make a simple Bash script ordered "$ run_program" (not a part of the $ command). CPP file.

I looked at Stackoverflow and other sites although I have not received a solid answer to help me

thanks.

This is the one that I have seen, though I could not head or tail it out.

I do not know the command to use to compile your C ++ program, but It can help you.

  1. Create a file with the ".sh" extension and open it with your favorite text editor.
  2. Paste this code (change the line along the line to a compilation that you are using to compile your program)

      #! / Bin / bash # Run it in the terminal + # c ++ command to compile the program. Here I have used a normal G ++ filename.cpp - exit any name 0  
  3. Now you need to run this script, To do this, open the terminal

    chmod u + x scriptname.sh

then the script by ./ scriptname.sh Let's hope it will compile your program.


No comments:

Post a Comment