compile c++ in terminal code example
Example 1: compile c++ linux
g++ foo.cpp -o foo //plus other extension like the opencv to compile correctly
Example 2: how to compile and run cpp code in terminal
# compile cpp_code.cpp
g++ cpp_code.cpp
# run compiled file
./a.out
Example 3: compile c++ program
$ g++ -o <name-you-want-to-give> source.cpp
$ ./myprogram
Example 4: terminal compile c++
g++ -o file file.cpp //or file.c