Monday, November 19, 2012

compile C++ in terminal.

1. use commands such as, pwd, ls, cd .... into the corresponding folder.
2. an example:

g++ -o main.o a.cpp b.cpp c.cpp main.cpp -lgsl -lgslcblas

make sure to include all .cpp,
-lgsl -lgslcblas in case of using gsl library.

3. ./main.o

an easier way of doing this:
write a batch.txt file including all necessary commands.
in terminal, type in: source batch.txt

No comments:

Post a Comment