By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,247 Members | 1,287 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,247 IT Pros & Developers. It's quick & easy.

Linking error when using multiple forms and #include<afxinet.h>

P: n/a
Hello!
I am developping a Visual C++ .NET multiple forms application, which
uses FTP connection. When I use more than one form, and include the
<afxinet.h> library (necessary for FTP connection), the linker errors
occur:

error LNK2005: "void * __cdecl operator new(unsigned
int)"(??2@YAPAXI@Z) already
defined in LIBCMTD.lib(new.obj)

error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
already defined in LIBCMTD.lib(dbgdel.obj)

fatal error LNK1169: one or more multiply defined symbols found

In order to be clearer, I'll tell the simple steps to create the
error: I create a Windows Form C++ .NET application; add a new form
(add element->new form); simply include the <afxinet.h> in the Form1.
Ok, if you try to run the application, it will. Now, just close the
Visual Studio, open everything again, do a NEW compilation, and try to
run. (!!!) That's the error! That's why I think it could be a bug
of the Visual Studio...

Thus, I can just work with FTP connection and only ONE form. We tried
the MSDN help, that tells to ignore the library (LIBCMTD.lib), but this
causes other link errors. We tried everything we could.
If somebody could help me anyway I thank very much.

Nov 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Are you using VC 2003 or 2005 ?

"Marcelo" wrote:
Hello!
I am developping a Visual C++ .NET multiple forms application, which
uses FTP connection. When I use more than one form, and include the
<afxinet.h> library (necessary for FTP connection), the linker errors
occur:

error LNK2005: "void * __cdecl operator new(unsigned
int)"(??2@YAPAXI@Z) already
defined in LIBCMTD.lib(new.obj)

error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)
already defined in LIBCMTD.lib(dbgdel.obj)

fatal error LNK1169: one or more multiply defined symbols found

In order to be clearer, I'll tell the simple steps to create the
error: I create a Windows Form C++ .NET application; add a new form
(add element->new form); simply include the <afxinet.h> in the Form1.
Ok, if you try to run the application, it will. Now, just close the
Visual Studio, open everything again, do a NEW compilation, and try to
run. (!!!) That's the error! That's why I think it could be a bug
of the Visual Studio...

Thus, I can just work with FTP connection and only ONE form. We tried
the MSDN help, that tells to ignore the library (LIBCMTD.lib), but this
causes other link errors. We tried everything we could.
If somebody could help me anyway I thank very much.

Nov 17 '05 #2

P: n/a
I am using the 2003 version

Nov 17 '05 #3

P: n/a
I already solved the problem. Thanks

Nov 17 '05 #4

P: n/a
What was the problem?

Brian

Nov 17 '05 #5

P: n/a
I just needed to set the option of Project ---> Porperties. In project
standards, I change the uses of MFC from Windows Standard Library to
Shared DLL. This way I can use the MFC libraries in a Windows Forms
Application (which is not MFC application

Nov 17 '05 #6

P: n/a
I just needed to set the option of Project ---> Porperties. In project
standards, I change the uses of MFC from Windows Standard Library to
Shared DLL. This way I can use the MFC libraries in a Windows Forms
Application (which is not MFC application. Very simple, but difficult
to find out

Nov 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.