How to compile and run C/C++ in a Unix console/Mac terminal?

前端 未结 16 1676
抹茶落季
抹茶落季 2020-11-30 16:32

How can I compile/run C or C++ in Unix console or a Mac terminal?

(I know it, forget it, and relearn it again. Time to write it down.)

16条回答
  •  半阙折子戏
    2020-11-30 16:57

    Use a makefile. Even for very small (= one-file) projects, the effort is probably worth it because you can have several sets of compiler settings to test things. Debugging and deployment works much easier this way.

    Read the make manual, it seems quite long at first glance but most sections you can just skim over. All in all it took me a few hours and made me much more productive.

提交回复
热议问题