cpp:“-c”不是预处理器的有效选项
我正在尝试在 RedHat 系统上构建一个包。首先,我运行 ./configure CXX=cpp,因为 /usr/bin/cpp 是该系统上的 C++ 编译器。但是当我运行 make 时,它会转储:
cpp: "-c" 不是预处理器的有效选项
当我进行 Google 搜索时,我发现了许多抱怨,但没有解决方案。还有其他人遇到过这种情况吗?
I'm trying to build a package on a RedHat system. First, I ran ./configure CXX=cpp, because /usr/bin/cpp is the C++ compiler on that system. But when I run make, it dumps:
cpp: "-c" is not a valid option to the preprocessor
When I do a Google search, I found a number of complaints, but no solutions. Anyone else encounter this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
cpp
是 C 预处理器;也许您的意思是cc
(C 编译器)或gcc
(对于 GNU C 编译器)或g++
(对于 GNU C++ 编译器)?cpp
is the C preprocessor; perhaps you meancc
(the C compiler) orgcc
(for GNU C compiler) org++
(for the GNU C++ compiler)?cpp
是预处理器,请尝试使用c++
代替。cpp
is the preprocessor, tryc++
instead.我必须安装 cpp-g++ 包。我不习惯Redhat系统,并且已经有一段时间没有构建C++程序了,因此我很困惑。
感谢大家的慷慨回应。
I had to install the cpp-g++ package. I'm not used to Redhat systems, and hadn't built a C++ program in quite a while, hence my confusion.
Thanks to all for your generous responses.
您可能正在寻找 g++(GNU C++ 编译器),因为 cpp 是 C 预处理器。
g++ 是 gcc 的特殊调用,它自动将 gcc 的 c++ 运行时所需的几个目录包含到库搜索路径中。
you probably are looking for g++ (GNU C++ Compiler) as cpp is the C preprocessor.
g++ is a special invocation of gcc in that it automatically includes a couple of directories needed for gcc's c++ runtime into the library search path.