During a C++ script compilation, and doing exe building in AIX 5.3 using xlC compiler, I get the warning shown below:

ld: 0711-224 WARNING: Duplicate symbol: .NotNode::NotNode(BoolNode*)
ld: 0711-224 WARNING: Duplicate symbol: .UnaryNode::UnaryNode(BoolNode*)
ld: 0711-224 WARNING: Duplicate symbol: .OrNode::OrNode(BoolNode*,BoolNode*)
ld: 0711-224 WARNING: Duplicate symbol: .BinaryNode::BinaryNode(BoolNode*,BoolNo
de*)
ld: 0711-224 WARNING: Duplicate symbol: .AndNode::AndNode(BoolNode*,BoolNode*)
ld: 0711-224 WARNING: Duplicate symbol: .LeafNode::LeafNode(const char*)
ld: 0711-224 WARNING: Duplicate symbol: .RegularExpression::RegularExpression(co
nst char*)
ld: 0711-224 WARNING: Duplicate symbol: .RegularExpression::Init(const char*)
ld: 0711-224 WARNING: Duplicate symbol: .UnaryNode::~UnaryNode()
ld: 0711-224 WARNING: Duplicate symbol: .UnaryNode::Dump(ostream&,int)
ld: 0711-224 WARNING: Duplicate symbol: .UnaryNode::Visit(int,void*)
ld: 0711-224 WARNING: Duplicate symbol: .BinaryNode::~BinaryNode()
ld: 0711-224 WARNING: Duplicate symbol: .BinaryNode::Dump(ostream&,int)
ld: 0711-224 WARNING: Duplicate symbol: .BinaryNode::Visit(int,void*)
ld: 0711-224 WARNING: Duplicate symbol: .StringDictionaryIterator::operator void
*()

The warning does not cause any problems in building EXE or during validation but too many warnings for building each EXE is annoying.

Can someone please help me on how to set the flag in Makefile so that this warning can be removed and build is done without this?

Recommended Answers

All 14 Replies

maybe you included the same header file more than once and left out the code guards.

Is this valid?.. #pragma warning(disable:'warn code') ..:p

>Is this valid?.. #pragma warning(disable:'warn code') ..:p
If you don't know what's causing a warning, you'd be a fool to disable it. I only know of one warning, on any compiler that I've ever used, where I'm 100% sure that it can be safely disabled. The correct response to a warning is understanding it and then fixing it.

>Is this valid?.. #pragma warning(disable:'warn code') ..:p
If you don't know what's causing a warning, you'd be a fool to disable it. I only know of one warning, on any compiler that I've ever used, where I'm 100% sure that it can be safely disabled. The correct response to a warning is understanding it and then fixing it.

yep..I just trying to set the flag not to understand it and fix it..Maybe u can fix it.:p

>I just trying to set the flag not to understand it and fix it
Clearly. That's why I felt the need to tell you that disabling a warning without understanding it is the height of stupidity. You're not stupid, are you?

Thank u very much sir..Don't know how to solve the problems sir..Could u tell us sir..:p

That attitude isn't likely to make you any friends.

The problem could be the result of several different things, and no one can tell you specifically without seeing the code. Another possible cause, besides the ones I already mentioned previously, is putting the implementation code in a header file. In that case it will be duplicated in every *.cpp file that uses the header file, thus the duplicate error message(s). The solution is to put the implementation code in one *.cpp file, leaving only the class declaration in the header file.

That attitude isn't likely to make you any friends.

that's ok..I'm sorry..:)

Assuming that the warnings are ok and they are arising out of so many different files, is there a way to supress them in the Makefile so that they dont pop up?

why not just fix the problem instead of trying to hide it.

But is there a way?

Probably -- I've already mentioned three things that you should look at. Could be one of them or none of them. But can't tell you if you don't post the code.

Assuming that the warnings are ok and they are arising out of so many different files, is there a way to supress them in the Makefile so that they dont pop up?

Consult the compiler documentation.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.