473,385 Members | 1,356 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,385 software developers and data experts.

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

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
6 3827
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
I am using the 2003 version

Nov 17 '05 #3
I already solved the problem. Thanks

Nov 17 '05 #4
What was the problem?

Brian

Nov 17 '05 #5
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Tuckers | last post by:
My question is, if I have created my own library which lives in its own install directory, to refer to its header file is it better to use #include "MyLibrary.h" or #include <MyLibrary.h> ...
9
by: bill | last post by:
Forget the exact definition of difference between, #include <foo.h> and #include "bar.h" Normally foo.h is a standard header file, so it's path is not defined in compiler option, but I...
5
by: mailtogops | last post by:
Hi All, This is very basic C/C++ question but I need internals of C/C++ how the langauge/compiler do this.. Say I have two header files 1. header1.h 2. header2.h
2
by: Jofio | last post by:
I have 3 files, namely: dArray.h dArray.cp TestdArray.cpp Problem is when I compile the 'main' program - TestdArray.cpp - , it (the compiller) produces the following error: 'Unable to open...
4
by: Anastasios Hatzis | last post by:
I'm looking for a pattern where different client implementations can use the same commands of some fictive tool ("foo") by accessing some kind of API. Actually I have the need for such pattern for...
3
by: suhailkhalil | last post by:
I'm using javascirpt calendar control and using the below statement to populate date in textbox txtDate. I'm using master page in VS2005. ...
3
by: Peterwkc | last post by:
Hello all expert C++ programmer, i fairly new to C++ programming. I have a class cellphone which contain dynamic pointer. I have create (example)ten cellphone. I want to ask user for the...
2
by: -Karl | last post by:
Couls someone please advise me on this error. What I am trying to do is be able to convert an XML document into arrays. I read that the subs & functions have to be in <scripttags. Thanks! ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: 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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.