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

M

Marcelo

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.
 
M

Marcelo

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
 
M

Marcelo

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
 

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

Top