I am a little new to ubuntu & linux, How do I make a shell command compile my source code I surfed and surfed and surfed but the net has no flies (confusing-ish?). So all I want it to do is get the directory then compile "main.cpp" to main I found:( in c++ I know it might look like this:
1 2 3
string curDir = pwd //print working directory
cd pwd
g++ main.cpp -o main
I don't get it. You want to make a shell script to compile your code, or you just want to compile from the command line? If the latter; you just type gxx [options if any] [-o outfile] infiles [more infiles if necessary]. Everything in square brackets is optional; if you don't specifiy -o outfile you get a.out; which is an old executable format.