My very first exploration with c++
g++ *.cpp -o executable_name
>> use this for compiling multiple source files and linking them.
g++ *.cpp -o executable_name -c
>> add with -c if you don't want to link the source files.
It is better to use CMake instead for best practice.