I am trying to run a custom c++ file so that it can link to Matlab and do the plotting. So far, my command in terminal to compile the .cpp file is as follow:
g++ inputfile.cpp -o outoutfile -I/usr/local/MATLAB/R2017a/extern/include -L/usr/local/MATLAB/R2017a/bin/glnxa64 -leng -lmx -lm -lmat -lut -lstdc++
The outputfile is then ran as:
./outputfile
Question is: Is there a shortcut so that I dont have to type out the path to include and links every time?
Please help, thanks.
P/S. I am currently on a Ubuntu machine, and I really do not want to go the IDE route (Visual Studio, CodeBlocks,.. etc.). I just want to code in a simple text editor, with terminal open to compile and run.
So far, I have tried 2 approaches: the 1st one is to have a text editor, a terminal and I manually enter the compile (with linked library syntax). This works every time but I got tired of writing the syntax all the time.
The 2nd approach is to use Sublime Text, I have made a custom built. This works half of the time.