[xsd-users] Re: question re. linking

Boris Kolpackov boris at codesynthesis.com
Tue Mar 13 16:28:33 EDT 2007


Hi Scott,


Miller, Scott (Kansas City) <scott.miller at securepassage.com> writes:

> I've subscribed to xsd-users forum to search...

Please also post your technical questions to this mailing list.
This way others will be able to find the answers to similar
questions by searching the archives. I've CC'ed xsd-users to
my reply.


> Until then...I'm getting "error LNK2005" error about code already
> existing in an existing .obj (the .obj created when I compile the
> generated .cpp file).  In my application .cpp I get link error
> (application.cpp includes the generated .h file).  What's
> recommended approach for ensuring the code only gets generated
> once?

I think you have the same schema constructs (ApplicationsType?)
defined in two separate schemas. The way to fix this is to move
common code to a separate schema and then include or import it
into the original schemas.

hth,
-boris


[The rest of the message follows for context.]

>
>
>
> Here's full error:
>
>
>
> ApplicationServer error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > &
> __cdecl xml::firemon::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class
> xml::firemon::ApplicationsType const &)"
> (??6firemon at xml@@YAAAV?$basic_ostream at DU?$char_traits at D@std@@@std@@AAV23 at ABVApplicationsType@01@@Z)
> already defined in EnumerateConfigurationsRequest.obj
>
>
>
> Here's include from application code:
>
>
>
> #include "../../Generated/EnumerateConfigurationsRequest.h"
>
> using xml::firemon::EnumerateConfigurationsRequest;
>
> using xml::firemon::EnumerateConfigurationsRequestType;
>
> using xml::firemon::ApplicationsType;
>
> using xml::firemon::ApplicationType;
>
> using xml::firemon::ConfigurationGroupsType;
>
> using xml::firemon::ConfigurationGroupType;
>
> using xml::firemon::DateTimeRangeType;
>
>
>
> Been in Java land for quite awhile...  J
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070313/fc31e261/attachment.pgp


More information about the xsd-users mailing list