Re: Linker Errors 2005 and 1104

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: dw85745 (dw85745_at_gbronline.com)
Date: 05/25/04


Date: Tue, 25 May 2004 15:47:27 -0700

Thanks Mr. Partch and Mr. Newcomer.

Got rid of the global and invoked Unicode.

Still compiles OK, but failing on linkage. What I find interesting is I'm
even failing on:
    error LNK2005: "public: __thiscall CString::CString(void)"
(??0CString@@QAE@XZ) already defined in mfc42u.lib(MFC42u.DLL)

Appears I'm twice defining something (????). How do I debug linkage errors?

Heres an sampling of the 100 errors of LNK 2005:

LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /INCREMENTAL:NO
specification
nafxcwd.lib(afxinl1.obj) : error LNK2005: "public: virtual void __thiscall
CObject::Serialize(class CArchive &)"
(?Serialize@CObject@@UAEXAAVCArchive@@@Z) already defined in NAQX.obj
nafxcwd.lib(afxinl1.obj) : error LNK2005: "public: __thiscall
CString::CString(void)" (??0CString@@QAE@XZ) already defined in
mfc42u.lib(MFC42u.DLL)
nafxcwd.lib(strex.obj) : error LNK2005: "public: void __thiscall
CString::TrimRight(void)" (?TrimRight@CString@@QAEXXZ) already defined in
mfc42u.lib(MFC42u.DLL)
nafxcwd.lib(strex.obj) : error LNK2005: "public: void __thiscall
CString::TrimLeft(void)" (?TrimLeft@CString@@QAEXXZ) already defined in
mfc42u.lib(MFC42u.DLL)
nafxcwd.lib(sockcore.obj) : error LNK2005: "public: __thiscall
CAsyncSocket::CAsyncSocket(void)" (??0CAsyncSocket@@QAE@XZ) already defined
in mfc42u.lib(MFC42u.DLL)
nafxcwd.lib(sockcore.obj) : error LNK2005: "public: virtual int __thiscall
CAsyncSocket::Accept(class CAsyncSocket &,struct sockaddr *,int *)"
(?Accept@CAsyncSocket@@UAEHAAV1@PAUsockaddr@@PAH@Z) already defined in
mfc42u.lib(MFC42u.DLL)
nafxcwd.lib(sockcore.obj) : error LNK2005: "public: virtual void __thiscall
CAsyncSocket::Close(void)" (?Close@CAsyncSocket@@UAEXXZ) already defined in
mfc42u.lib(MFC42u.DLL)
nafxcwd.lib(sockcore.obj) : error LNK2005: "public: virtual int __thiscall
CAsyncSocket::Receive(void *,int,int)" (?Receive@CAsyncSocket@@UAEHPAXHH@Z)
already defined in mfc42u.lib(MFC42u.DLL)
nafxcwd.lib(sockcore.obj) : error LNK2005: "public: virtual int __thiscall
CAsyncSocket::Send(void const *,int,int)" (?Send@CAsyncSocket@@UAEHPBXHH@Z)
already defined in mfc42u.lib(MFC42u.DLL)
nafxcwd.lib(sockcore.obj) : error LNK2005: "protected: virtual void
__thiscall CAsyncSocket::OnOutOfBandData(int)"
(?OnOutOfBandData@CAsyncSocket@@MAEXH@Z) already defined in
mfc42u.lib(MFC42u.DLL)
nafxcwd.lib(sockcore.obj) : error LNK2005: "protected: virtual void
__thiscall CAsyncSocket::OnAccept(int)" (?OnAccept@CAsyncSocket@@MAEXH@Z)
already defined in mfc42u.lib(MFC42u.DLL)
n

Thanks
David
----------------------------

"dw85745" <dw85745@gbronline.com> wrote in message
news:a5ydnXEtsuGuJi3dRVn-sA@gbronline.com...
> I received the following link errors:
>
> Linking...
> NAQXCtl.obj : error LNK2005: "class CMyConnMngr * g_pMyConnMngr"
> (?g_pMyConnMngr@@3PAVCMyConnMngr@@A) already defined in NAQX.obj
> NAQXPpg.obj : error LNK2005: "class CMyConnMngr * g_pMyConnMngr"
> (?g_pMyConnMngr@@3PAVCMyConnMngr@@A) already defined in NAQX.obj
> LINK : warning LNK4075: ignoring /EDITANDCONTINUE due to /INCREMENTAL:NO
> specification
> LINK : fatal error LNK1104: cannot open file "mfc42u.lib"
> Error executing link.exe.
>
> ------------------------------------------
> Error 2005
>
> MSDN says:
>
> The most common cause of this error is accidentally linking with both the
> single-threaded and multithreaded libraries. Ensure that the application
> project file includes only the appropriate libraries and that any
> third-party libraries have appropriately created single-threaded or
> multithreaded versions.
>
>
> QUESTION:
>
> How do I change whether I'm using single-threaded or multi-threaded within
> VC++6??
> BTW: I am using one library which I was provided and included in
> Project/Settings/Link.
> -----------------------------------------
>
> -----------------------------------------
> Error 1104
>
> MSDN says:
>
> cannot open file "filename"
>
> The tool could not open the given file. May not exist.
>
>
> QUESTION:
> Is mfc42u.lib used with VC6++?
> If not why is it showing up -- for example referenced in the library which
I
> was provided and included in Project/Settings/Link??
> -------------------------------------------
>
> Thanks
> David
>
>



Relevant Pages

  • Re: Cant Find Headers on OSX
    ... Calvin Spealman schrieb: ... with Python.h trying to include and failing to find any of the shared ... libraries. ...
    (comp.lang.python)
  • Re: linklisted load library failing
    ... We IPL'd on Saturday and last night all sorts of jobs started ... I then removed both of those libraries and now get an s806 ... None of the programs that are failing are ... We're in the process of having steplibs added to the jobs that are affected ...
    (bit.listserv.ibm-main)
  • Re: linking to libraries on A series
    ...  Some languages cannot directly talk to system libraries ... There is no explicit library linkage ... handled by the hardware without further MCP involvement. ... environments, and the most common of these was when the primary ...
    (comp.sys.unisys)
  • Re: linking to libraries on A series
    ... Some languages cannot directly talk to system libraries, and you need to write a jacket library to translate parameters and results from one environment to the other. ... There is no explicit library linkage call, at least in COBOL. ... The first time a program calls an entry point in a server library, the MCP traps the call, checks for compatible parameter sequences, sets up the address linkage, and restarts the call. ...
    (comp.sys.unisys)
  • Cant Find Headers on OSX
    ... I'm still on 10.4 and I'm trying to build pyOpenSSL, but I'm failing ... libraries. ... I depend on your acceptance of my opinion! ...
    (comp.lang.python)