|
| DrChill (308) | |||
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:
| |||
Last edited on | |||
| DrChill (308) | |
| nvm I feel stupid now | |
| chrisname (1342) | |
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.Oh, and xx is either cc or ++. | |
Last edited on | |
| kevinchkin (363) | |||
| If you want shell script. Then check out below scriptname
Then chmod 700 scriptname Finally, in your .profile add the path for the location of your script. Then just create an alias for the script name and you'll be good to go. :-) | |||
| bigearsbilly (8) | |||||
| you can use make. if your file is called main.cpp (or main.c) make main will do it. note only for simple progs, not if you have multiple source files. (headers are fine) and no you don't need a makefile you use the implicit rules. Or if you want to be silly!!! clever.cpp
then...
etc etc the silliness is endless | |||||
Registered users can post in this forum.
