compilation problem: LIBID already defined in...

S

shannontbailey

I reorganized my VC6 MFC project a bit, and ended up having to rebuild
my precompiled header file. I'm not sure if that is relevant or not. I
can't get past the following error, however:

MISO_i.obj : error LNK2005: _LIBID_MISOLib already defined in MISo_Obj

(MISO being the name of the application.)

Any ideas?
 
V

Victor Bazarov

I reorganized my VC6 MFC project a bit, and ended up having to rebuild
my precompiled header file. I'm not sure if that is relevant or not. I
can't get past the following error, however:

MISO_i.obj : error LNK2005: _LIBID_MISOLib already defined in MISo_Obj

(MISO being the name of the application.)

Any ideas?

Not really. Precompiled headers, MFC, are off-topic here. It is
possible to speculate that your symbol has multiple definition, and
the cause of it could be that you placed it in a header that is now
included in more than one translation unit. If that's the case, see
if declaring it 'extern' helps. You will also need to define it in
one of the units without 'extern'.

V
 
S

shannontbailey

I'm very familiar with a LNK2005 error resulting from symbols that *I*
defined more than once, and with using 'extern' to circumvent that
problem.

That's not what's happening here, though. LIBID_MISOLib isn't a symbol
or variable, it's a library that the compiler is creating. Thus, I'm
clueless as to the cause of the linker error.
 
S

shannontbailey

Oops. :)

You're right. Obviously it was a globally -- and multiply -- defined
numeric value. Fixed.
 
V

Victor Bazarov

I'm very familiar with a LNK2005 error resulting from symbols that *I*
defined more than once, and with using 'extern' to circumvent that
problem.

That's not what's happening here, though. LIBID_MISOLib isn't a symbol
or variable, it's a library that the compiler is creating. Thus, I'm
clueless as to the cause of the linker error.

If your linker says that something is multiply defined, it _is_ a symbol.
There is nothing except a symbol that can be multiply defined. Period.

Apparently something in your MISO_i.obj is the result of defining that
symbol, as well as in MISo_Obj. That's what your linker is telling you.
It's a different story whether you can do anything about it.

If it's not your symbol, it must come from a header you include directly
or indirectly. Check all headers for that symbol. Rebuild all. Blow
away all precompiled headers before doing that...

If that doesn't help, contact the creators of the library you think is
the culprit. Post to microsoft.public.vc.language if you think you need
more explanation about compiler-specific ways dealing with libraries.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,664
Latest member
RoseannBow

Latest Threads

Top