gpt4 book ai didi

c++ - 如何将 Makefile 的隐式规则与 .cpp 文件一起使用?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:55:19 26 4
gpt4 key购买 nike

在 C++ 文件的 Makefile 中有一个隐式规则,它使用 .C 或 .cc 扩展名。但我通常使用 C++ 源文件的 .cpp 文件扩展名。

如何将 Makefile 的隐式规则用于 .cpp 文件?

最佳答案

参见 Catalogue of Implicit Rules :

Compiling C++ programs

n.o is made automatically from n.cc, n.cpp, or n.C with a recipe of the form ‘$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c’. We encourage you to use the suffix ‘.cc’ for C++ source files instead of ‘.C’.

关于c++ - 如何将 Makefile 的隐式规则与 .cpp 文件一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14569553/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com