[program-l] Re: C++ linker question

  • From: Soronel Haetir <soronel.haetir@xxxxxxxxx>
  • To: program-l@xxxxxxxxxxxxx
  • Date: Sun, 26 Feb 2017 07:21:47 -0900

From Maike's description I suspect the functions are defined (not just
declared) in a header file and that header is being included in more
than one translation unit.

If I am correct about that then the correct solution is to add
'inline' to the definitions.

On 2/26/17, Jaffar Sidek <jaffar.sidek10@xxxxxxxxx> wrote:

Do your two functions contain the same structure definitions?


On 2/26/2017 7:58 PM, Mike Fox wrote:
Hey what's up guys,

I've got 2 functions with the same name, but in different namespaces;
this is part of a DLL I'm creating.  And as always, the good old
linker throws me yet another wacky curveball... the functions are
already defined.  This would make perfect sense, had I not used
namespaces (i.e. 2 functions named Foo is an obvious error); but
because it's A::Foo and B::Foo this doesn't make sense... at least not
from a human perspective. *smile*

Anyway, one obvious fix to the problem would be to rename the
functions in B, which I'll do if there's just no other way, but I'd
sure like to know more about this and haven't been able to fish up
much from Google.  Any thoughts?

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq



-- 
Soronel Haetir
soronel.haetir@xxxxxxxxx
** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: