The program searches for the .cpp files then tries compiles it. Otherwise displays the compilation error.
If you want to try the program you could try it in the demo folder.
The demo program prints out input arguments to the terminal, if there is none prints out './a.out'
.
Demo usage:
cd demo/
cppcompile.sh banana 5 4.8
Output should be:
Program arguments are: 'banana', '5', '4.8'.
cppcompile.sh [Argument1] [Argument2] ...
NOTE: In the case of multiple input arguments, each argument has to be separated with a space
If you want to make modifications to the script, for example using a different c++ standard, (not c++20) then do that firstly before running the commands below.
For using the script you need to download it.
git clone https://github.com/MemerGamer/cppcompile.git
cd cppcompile/
After downloading you need to make it an executable
chmod +x ./cppcompile.sh
After that you need to copy the script to the /usr/bin
directory.
For this you will need to be a sudoer!
sudo cp ./cppcompile.sh /usr/bin/
(You will need GitBash or WSL enabled)
After downloading you need to put cppcompile_win.sh
in a folder, or create a folder somewhere secure.
After that you need to put the folders path in the environment variables.
Example
Now you can use it in the Windows Terminal like:
cppcompile_win.sh [Argument1] [Argument2] ...