duplicate symbol

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2008
Posts: 48
Reputation: etc123 is an unknown quantity at this point 
Solved Threads: 0
etc123 etc123 is offline Offline
Light Poster

duplicate symbol

 
0
  #1
Mar 11th, 2009
During a C++ script compilation, and doing exe building in AIX 5.3 using xlC compiler, I get the warning shown below:

  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?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,412
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1469
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: duplicate symbol

 
0
  #2
Mar 11th, 2009
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 320
Reputation: cikara21 is an unknown quantity at this point 
Solved Threads: 63
cikara21's Avatar
cikara21 cikara21 is offline Offline
Posting Whiz

Re: duplicate symbol

 
0
  #3
Mar 11th, 2009
Is this valid?.. #pragma warning(disable:'warn code') ..:p
Last edited by cikara21; Mar 11th, 2009 at 2:24 pm.
.:-cikara21-:.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,680
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 727
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: duplicate symbol

 
1
  #4
Mar 11th, 2009
>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.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 320
Reputation: cikara21 is an unknown quantity at this point 
Solved Threads: 63
cikara21's Avatar
cikara21 cikara21 is offline Offline
Posting Whiz

Re: duplicate symbol

 
0
  #5
Mar 11th, 2009
Originally Posted by Narue View Post
>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
.:-cikara21-:.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,680
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 727
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: duplicate symbol

 
1
  #6
Mar 11th, 2009
>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?
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 320
Reputation: cikara21 is an unknown quantity at this point 
Solved Threads: 63
cikara21's Avatar
cikara21 cikara21 is offline Offline
Posting Whiz

Re: duplicate symbol

 
0
  #7
Mar 11th, 2009
Thank u very much sir..Don't know how to solve the problems sir..Could u tell us sir..:p
.:-cikara21-:.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,680
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 727
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: duplicate symbol

 
1
  #8
Mar 11th, 2009
That attitude isn't likely to make you any friends.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,412
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1469
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: duplicate symbol

 
0
  #9
Mar 11th, 2009
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 320
Reputation: cikara21 is an unknown quantity at this point 
Solved Threads: 63
cikara21's Avatar
cikara21 cikara21 is offline Offline
Posting Whiz

Re: duplicate symbol

 
0
  #10
Mar 11th, 2009
Originally Posted by Narue View Post
That attitude isn't likely to make you any friends.
that's ok..I'm sorry..
.:-cikara21-:.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC