473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 8738

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jeffrey Holle | last post by:
I am working on a Linux system using gcc v3.3 and python v2.3.2 I have a problem linking a cpp program to a shared library that uses the Python C API. With just referencing this shared library, I...
1
by: Jeff Hagelberg | last post by:
I'm trying to create a python module which can be used by a python interpreter embedded inside a fortran program I have. To do this, I first created python wrappers for all the functions in my...
0
by: Wolfgang | last post by:
I have a problem with linking my CPP Code under a irix6 machine (sgi, UNIX). In my CPP code I use some Functions which are written in Python. So its a kind of CPP wrapper for my Python functions In...
0
by: Si | last post by:
Hi, I am having trouble with an install of Oracle 9i Release 2 on Linux Mandrake 9.1. I have 512 MB DDR RAM and a Duron 850 CPU. The install appeared to run fairly seamlessly except for a...
1
by: manish | last post by:
Hi, I am a fresher in the programming field i.e although I have done programming at the basic level but at professional level I am very new and I am facing many problems. These probllems are...
15
by: Rob Ratcliff | last post by:
I'm compiling the latest version of a CORBA ORB called MICO on a Cray X1. It makes heavy use of templates and namespaces. Up until the link step, the C++ source code compiled flawlessly. But, when...
2
by: bobnotbob | last post by:
I have created an application and am trying to call functions from a previously existing dll. I can call some functions fine, but I get a link error an when I try to call any function that takes...
1
by: jdola | last post by:
I have a customer that is using Access to create reports from FoxPro tables. We started noticing problems with the indexes on the FoxPro tables. It is to the point where we have to delete and...
19
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.