[omniORB] LNK warning and error

Bjørn Wennberg bjornw@colargol.idb.hist.no
12 Jun 1999 01:01:57 +0200


"Hai Wang" <wangh@Teltec.DCU.IE> writes:

> Hi All,
> 	I wrote two IDL modules in one IDL file, each contains several
> attributes, one interface and two operations respectively. I have
> implemented one module, it works well, but we I tried to implement the
> another one, several Link warnings and errors took place as follows:
> 
>  (A is the interface in the first module)
>  (B is the interface in the Second module)
> 
> 	error LNK2005: _AtlIPersistStreamInit_Load@16 already defined
> in A_i.obj
> B_i.obj : error LNK2005: _AtlIPersistStreamInit_Save@20 already
> defined in A_i.obj

[snip]
> 
> I appreciate If any of you can give me some suggestions!
> 
> Thanks in advance!
> Hai
> 

If you would try to narrow down your code and post it (together with
the compile-time options) it would be much easier to (try) understand
what is going on :-)

Anyway: It seems to me that you either a) are linking the same object
file twice b) you have two source-files that defines the same methods.
One tips would be to make sure you have
#ifndef _header_file_included
#define _header_file_included
header-file definition
#endif
put in all your header-files...

bjornw>
-- 
-------------------------------------------------------
Bjørn Wennberg       email: bjornw@tihlde.org
                        ms: +47 959 92 657