Operating System - HP-UX
1820399 Members
3298 Online
109624 Solutions
New Discussion юеВ

Re: ld: gives Duplicate Symbol error

 
Satya_6
Frequent Advisor

ld: gives Duplicate Symbol error

Hi,

I recently upgraded my aCC compilers from A03.30 to A03.65 and with the new compiler I am getting a linker error of "Duplicate symbols" for some symbols. After some investiagation we could find that we get this problem because of the following explicit instantiation of a template class like
"template class vector;" in a header file.

I have removed this code and am able to build my projects, but still I get the same error with some other projects as well. Now I am confused as to what is the exact reason for this error, how my old compiler could get around some improper code constructs.

Can you please help to resolve this issue

TIA
Satya
2 REPLIES 2
Peter Godron
Honored Contributor

Re: ld: gives Duplicate Symbol error

Dennis Handly
Acclaimed Contributor

Re: ld: gives Duplicate Symbol error

>Peter "problem" was fixed in 3.31

In some of Peter's links it mentions don't put it in a .h file. This is correct. The C++ Standard doesn't allow multiple explicit instantiations, this would violate the ODR rule, 3.2.