【发布时间】:2013-09-29 20:11:05
【问题描述】:
我正在编译一组 .C 文件并尝试使用 xlC 编译器版本 9.0 在 AIX 6.0 上创建目标文件。它产生以下错误:
1540-1172 (S) More than one function "operator new" has non-C++ linkage.
1540-0424 (I) "operator new" is declared on line 92 of "/usr/vacpp/include/new".
1540-0121 (S) A template cannot have "C" linkage.
1540-0140 (S) The text "<" is unexpected. "List" may be undeclared, ambiguous, or may require "typename" qualification.
我们将不胜感激任何形式的指导或帮助。
$ xlC -qversion
C for AIX version 6.0.0.0
编译器 xlC 只是一个 C++ 编译器。我已经验证 #include 周围没有 extern 'C' 。如果有人对此进行了研究,请告诉我解决方案。
【问题讨论】:
-
这几乎没用。您可以考虑显示与消息关联的源代码。
-
从所提供的最少信息中很难确定哪里出了问题。看起来您可能有:
extern "C" {,后跟#include <new>和},三行。或者,可能是您使用的是 C 编译器而不是 C++ 编译器,但这更有可能抱怨operator new的语法而不是允许它,除非有几个operator new声明都带有extern "C"link。
标签: c compiler-construction aix linkage xlc