943,691 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 5129
  • C++ RSS
You are currently viewing page 1 of this multi-page discussion thread
Mar 11th, 2009
0

duplicate symbol

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

C++ Syntax (Toggle Plain Text)
  1. ld: 0711-224 WARNING: Duplicate symbol: .NotNode::NotNode(BoolNode*)
  2. ld: 0711-224 WARNING: Duplicate symbol: .UnaryNode::UnaryNode(BoolNode*)
  3. ld: 0711-224 WARNING: Duplicate symbol: .OrNode::OrNode(BoolNode*,BoolNode*)
  4. ld: 0711-224 WARNING: Duplicate symbol: .BinaryNode::BinaryNode(BoolNode*,BoolNo
  5. de*)
  6. ld: 0711-224 WARNING: Duplicate symbol: .AndNode::AndNode(BoolNode*,BoolNode*)
  7. ld: 0711-224 WARNING: Duplicate symbol: .LeafNode::LeafNode(const char*)
  8. ld: 0711-224 WARNING: Duplicate symbol: .RegularExpression::RegularExpression(co
  9. nst char*)
  10. ld: 0711-224 WARNING: Duplicate symbol: .RegularExpression::Init(const char*)
  11. ld: 0711-224 WARNING: Duplicate symbol: .UnaryNode::~UnaryNode()
  12. ld: 0711-224 WARNING: Duplicate symbol: .UnaryNode::Dump(ostream&,int)
  13. ld: 0711-224 WARNING: Duplicate symbol: .UnaryNode::Visit(int,void*)
  14. ld: 0711-224 WARNING: Duplicate symbol: .BinaryNode::~BinaryNode()
  15. ld: 0711-224 WARNING: Duplicate symbol: .BinaryNode::Dump(ostream&,int)
  16. ld: 0711-224 WARNING: Duplicate symbol: .BinaryNode::Visit(int,void*)
  17. ld: 0711-224 WARNING: Duplicate symbol: .StringDictionaryIterator::operator void
  18. *()

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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
etc123 is offline Offline
49 posts
since May 2008
Mar 11th, 2009
0

Re: duplicate symbol

maybe you included the same header file more than once and left out the code guards.
Last edited by Ancient Dragon; Mar 11th, 2009 at 12:23 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is online now Online
21,950 posts
since Aug 2005
Mar 11th, 2009
0

Re: duplicate symbol

Is this valid?.. #pragma warning(disable:'warn code') ..:p
Last edited by cikara21; Mar 11th, 2009 at 2:24 pm.
Reputation Points: 47
Solved Threads: 69
Posting Whiz
cikara21 is offline Offline
340 posts
since Jul 2008
Mar 11th, 2009
1

Re: duplicate symbol

>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.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Mar 11th, 2009
0

Re: duplicate symbol

Click to Expand / Collapse  Quote originally posted by Narue ...
>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
Reputation Points: 47
Solved Threads: 69
Posting Whiz
cikara21 is offline Offline
340 posts
since Jul 2008
Mar 11th, 2009
1

Re: duplicate symbol

>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?
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Mar 11th, 2009
0

Re: duplicate symbol

Thank u very much sir..Don't know how to solve the problems sir..Could u tell us sir..:p
Reputation Points: 47
Solved Threads: 69
Posting Whiz
cikara21 is offline Offline
340 posts
since Jul 2008
Mar 11th, 2009
1

Re: duplicate symbol

That attitude isn't likely to make you any friends.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Mar 11th, 2009
0

Re: duplicate symbol

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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is online now Online
21,950 posts
since Aug 2005
Mar 11th, 2009
0

Re: duplicate symbol

Click to Expand / Collapse  Quote originally posted by Narue ...
That attitude isn't likely to make you any friends.
that's ok..I'm sorry..
Reputation Points: 47
Solved Threads: 69
Posting Whiz
cikara21 is offline Offline
340 posts
since Jul 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: how to get and use large size array?
Next Thread in C++ Forum Timeline: Using function parameters defined in if statement





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC