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

前端 未结 11 829
耶瑟儿~
耶瑟儿~ 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:18

    You can still use g++ directly if you want:

    g++ f1.cpp f2.cpp main.cpp
    

    where f1.cpp and f2.cpp are the files with the functions in them. For details of how to use make to do the build, see the excellent GNU make documentation.

提交回复
热议问题