WiredWX Hobby Weather ToolsLog in

 


descriptionxlC compiler v 6.0 : Duplicate Symbol EmptyxlC compiler v 6.0 : Duplicate Symbol

more_horiz
Hi,

While compiling a c++ code and doing exe building in AIX 5.3 using xlC compiler, we are getting the below warning.

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::RegularExpres​sion(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 dont cause any problem 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?

Thanks in advance!!!

descriptionxlC compiler v 6.0 : Duplicate Symbol EmptyRe: xlC compiler v 6.0 : Duplicate Symbol

more_horiz
The warning could be caused by different things, and no one can tell you specifically without seeing the code.

maybe you included the same header file more than once and left out the code guards, 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.

descriptionxlC compiler v 6.0 : Duplicate Symbol EmptyRe: xlC compiler v 6.0 : Duplicate Symbol

more_horiz
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?

descriptionxlC compiler v 6.0 : Duplicate Symbol EmptyRe: xlC compiler v 6.0 : Duplicate Symbol

more_horiz
Why not try to fix the problem instead of trying to hide it?

I have also mentioned the three things that you should look at. Could be one of them or none of them. But I can't figure it out you if you don't post the code.

descriptionxlC compiler v 6.0 : Duplicate Symbol EmptyRe: xlC compiler v 6.0 : Duplicate Symbol

more_horiz
As a programmer myself, I can tell you that trying to hide these errors can be a bad thing. The more you do this, the more cluttered the source code becomes which makes it more difficult to edit later if needed.

One of my largest rules: Always write code as if you where writing it for someone else to read.

Also remember, what is a simple problem now can become a big problem later. If you dont debug your apps every once in a while, you can wind up with days or even weeks of wasted time trying to fix everything that you put off before.

descriptionxlC compiler v 6.0 : Duplicate Symbol EmptyRe: xlC compiler v 6.0 : Duplicate Symbol

more_horiz
privacy_tip Permissions in this forum:
You cannot reply to topics in this forum