470,565 Members | 1,792 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,565 developers. It's quick & easy.

problems while linking in MFc app

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::operator<<(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::operator<<(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
Jul 19 '05 #1
3 8586

"rama" <me******@hotmail.com> wrote in message
news:ee**************************@posting.google.c om...
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::operator<<(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
news:microsoft.public.vc.language or
news:comp.os.ms-windows.programmer.tools.mfc for instance.

john
Jul 19 '05 #2
>
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
Jul 19 '05 #3
1. Try add to "project properties/linker/input/ignore libraries": libc,
nafxcw
2. Try /Force option.

Alex

"rama" <me******@hotmail.com> wrote in message
news:ee**************************@posting.google.c om...
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::operator<<(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::operator<<(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

Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jeffrey Holle | last post: by
1 post views Thread by Jeff Hagelberg | last post: by
15 posts views Thread by Rob Ratcliff | last post: by
2 posts views Thread by bobnotbob | last post: by
1 post views Thread by livre | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.