Found out that i should build g++ -o output name file1 file2 file3 ...