make: implicit rule to link c++ project

后端 未结 7 1076
礼貌的吻别
礼貌的吻别 2020-12-31 04:52

I am working my way through a make tutorial. Very simple test projects I am trying to build has only 3 files: ./src/main.cpp ./src/implementation.cpp and

7条回答
  •  佛祖请我去吃肉
    2020-12-31 05:16

    There supposed to be an implicit rule for prog or I am missing something?

    There is no implicit rule. make cannot know how to build prog because it doesn’t know that prog is supposed to be an executable. make only uses the file name as a pattern to deduce the build rule. prog is a generic file name without extension so make doesn’t know how to treat it.

提交回复
热议问题