Using G++ to compile multiple .cpp and .h files

前端 未结 11 930
耶瑟儿~
耶瑟儿~ 2020-11-22 09:43

I\'ve just inherited some C++ code that was written poorly with one cpp file which contained the main and a bunch of other functions. There are also .h files th

11条回答
  •  独厮守ぢ
    2020-11-22 10:31

    ~/In_ProjectDirectory $ g++ coordin_main.cpp coordin_func.cpp coordin.h

    ~/In_ProjectDirectory $ ./a.out

    ... Worked!!

    Using Linux Mint with Geany IDE

    When I saved each file to the same directory, one file was not saved correctly within the directory; the coordin.h file. So, rechecked and it was saved there as coordin.h, and not incorrectly as -> coordin.h.gch. The little stuff. Arg!!

提交回复
热议问题