problems while linking in MFc app

R

rama

HI,
I have a win32 application that works okay but when i use the same
classes in a MFC application , i am faced with problems. I am
including a library into the MFC applicationand compilation goes fine.
Please let me know what is wrong.

Errors:

Linking...
msvcirtd.lib(MSVCIRTD.dll) : error LNK2005: "public: class ostream &
__thiscall ostream::eek:perator<<(class ostream & (__cdecl*)(class
ostream &))" (??6ostream@@QAEAAV0@P6AAAV0@AAV0@@Z@Z) already defined
in improv-2.3.1.lib(Options.obj)
libci.lib(_ios.obj) : error LNK2005: "protected: __thiscall
ios::ios(void)" (??0ios@@IAE@XZ) already defined in
msvcirtd.lib(MSVCIRTD.dll)
libci.lib(_ios.obj) : error LNK2005: "public: virtual __thiscall
ios::~ios(void)" (??1ios@@UAE@XZ) already defined in
msvcirtd.lib(MSVCIRTD.dll)
libci.lib(ostream.obj) : error LNK2005: "public: class ostream &
__thiscall ostream::eek:perator<<(char const *)"
(??6ostream@@QAEAAV0@PBD@Z) already defined in
msvcirtd.lib(MSVCIRTD.dll)
libci.lib(ostream.obj) : error LNK2005: "public: class ostream &
__thiscall ostream::flush(void)" (?flush@ostream@@QAEAAV1@XZ) already
defined in msvcirtd.lib(MSVCIRTD.dll)
LIBC.lib(crt0dat.obj) : error LNK2005: _exit already defined in
msvcrtd.lib(MSVCRTD.dll)
LIBC.lib(crt0dat.obj) : error LNK2005: __exit already defined in
msvcrtd.lib(MSVCRTD.dll)
LIBC.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in
msvcrtd.lib(cinitexe.obj)
LIBC.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in
msvcrtd.lib(cinitexe.obj)
LIBC.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in
msvcrtd.lib(cinitexe.obj)
LIBC.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in
msvcrtd.lib(cinitexe.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in
LIBC.lib(mbctype.obj)
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of
other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other
libs; use /NODEFAULTLIB:library
midi2text.obj : error LNK2001: unresolved external symbol "private:
void __thiscall midi2text::example(void)" (?example@midi2text@@AAEXXZ)
midiGUI.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

midiGUI.exe - 14 error(s), 2 warning(s)

Thanks,
Meera
 
J

John Harrison

rama said:
HI,
I have a win32 application that works okay but when i use the same
classes in a MFC application , i am faced with problems. I am
including a library into the MFC applicationand compilation goes fine.
Please let me know what is wrong.

Errors:

Linking...
msvcirtd.lib(MSVCIRTD.dll) : error LNK2005: "public: class ostream &
__thiscall ostream::eek:perator<<(class ostream & (__cdecl*)(class
ostream &))" (??6ostream@@QAEAAV0@P6AAAV0@AAV0@@Z@Z) already defined
in improv-2.3.1.lib(Options.obj)

[snip]

This is caused by having the wrong compiler options set when you compile.
For advice on how to operate your compiler you should ask in a compiler
group, this is not a language issue (which is what we discuss here). Try
or
for instance.

john
 
J

John Harrison

This is caused by having the wrong compiler options set when you compile.

I should say, having different compiler options when you compile your
library, from the compiler options you use when you compile your
application.

john
 
A

Alex Sedow

1. Try add to "project properties/linker/input/ignore libraries": libc,
nafxcw
2. Try /Force option.

Alex
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top