2

I'm compiling a set of .C files and trying to create object files on AIX 6.0 using xlC compiler version 9.0. It's generating the following errors:

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.

Any kind of guidance or help would be appreciated.

$ xlC -qversion
C for AIX version 6.0.0.0

The compiler xlC is a C++ compiler only. I've verified there is no extern 'C' around #include . Please let me know the solution if anyone has worked on this.

  • 2
    This is pretty much useless as is. You might consider showing the source code associated with the messages. – EvilTeach Sep 24 '13 at 23:38
  • It is going to be hard to determine what is wrong from the minimal information provided. It looks as though you might have: `extern "C" {` followed by `#include ` and `}` on three lines. Alternatively, it might be that you're using a C compiler instead of a C++ compiler, but that is more likely to complain about the syntax of `operator new` than to allow it except for the fact that there are several declarations of `operator new` all with `extern "C"` linkage. – Jonathan Leffler Sep 25 '13 at 07:03

1 Answers1

1

That message happens when you try to overload functions inside extern "C"


extern "C"{
struct A{};
struct B{};
void test(A arg);
void test(B arg);
}


"q.cpp", line 5.9: 1540-1172 (S) More than one function "test" has non-C++ linkage.
"q.cpp", line 4.9: 1540-0424 (I) "test" is declared on line 4 of "q.cpp".