473,406 Members | 2,387 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,406 software developers and data experts.

ASP.NET C++ LNK1120 error

Hi all.

I try to run following code in C++.NET ASP.NET project. The code is:

FolderItem.cpp
============

#include "stdafx.h"
#include "FolderItem.h"

FolderItem::FolderItem(int i){ }
FolderItem::~FolderItem(){ }

FolderItem.h
==========

#ifndef EA_06B8EBB7_4E18_4f42_9F1E_3B0DF280308D__INCLUDED_
#define EA_06B8EBB7_4E18_4f42_9F1E_3B0DF280308D__INCLUDED_

class FolderItem{

public:
FolderItem(int i);
virtual ~FolderItem();
};
#endif
I try to run this code and get following errors:

ContentManager error LNK2001: unresolved external symbol "void __cdecl
operator delete(void *)" (??3@$$FYAXPAX@Z)
ContentManager error LNK2001: unresolved external symbol "void
__stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
(__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
ContentManager fatal error LNK1120: 2 unresolved externals

If I put constructor / destructor inside header file, compilation
successes.
Is somebody know the type of the problem ?

thank you.

Aug 27 '06 #1
2 2945
sn***@yahoo.com wrote:
I try to run following code in C++.NET ASP.NET project.
I'm not really familiar with what C++.NET is and how it differs from
ordinary C++. What you want to do is compile your program as a C++
program - leave the .NET stuff out.

The code is:
>
FolderItem.cpp
============

#include "stdafx.h"
Try deleting the above line entirely and rebuilding the program. Does
that fix the problem?
#include "FolderItem.h"

FolderItem::FolderItem(int i){ }
FolderItem::~FolderItem(){ }

FolderItem.h
==========

#ifndef EA_06B8EBB7_4E18_4f42_9F1E_3B0DF280308D__INCLUDED_
#define EA_06B8EBB7_4E18_4f42_9F1E_3B0DF280308D__INCLUDED_

class FolderItem{

public:
FolderItem(int i);
virtual ~FolderItem();
};
#endif
I try to run this code and get following errors:

ContentManager error LNK2001: unresolved external symbol "void __cdecl
operator delete(void *)" (??3@$$FYAXPAX@Z)
ContentManager error LNK2001: unresolved external symbol "void
__stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
(__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
ContentManager fatal error LNK1120: 2 unresolved externals

If I put constructor / destructor inside header file, compilation
successes.
Is somebody know the type of the problem ?
If the above suggestion doesn't work, try building the following, in a
single .cpp file without any headers:

class FolderItem{
public:
FolderItem(int i);
virtual ~FolderItem();
};

FolderItem::FolderItem(int) { }
FolderItem::~FolderItem() { }

int main()
{
FolderItem f(0);
}

If that works, there appears to be some problem with how you've set up
your project - there is no C++ problem with your code. But if the .NET
stuff is the problem, you'll probably get better help on a Microsoft
newsgroup.

Best regards,

Tom

Aug 27 '06 #2

Thomas Tutone כתב:
sn***@yahoo.com wrote:
I try to run following code in C++.NET ASP.NET project.

I'm not really familiar with what C++.NET is and how it differs from
ordinary C++. What you want to do is compile your program as a C++
program - leave the .NET stuff out.

The code is:

FolderItem.cpp
============

#include "stdafx.h"

Try deleting the above line entirely and rebuilding the program. Does
that fix the problem?
#include "FolderItem.h"

FolderItem::FolderItem(int i){ }
FolderItem::~FolderItem(){ }

FolderItem.h
==========

#ifndef EA_06B8EBB7_4E18_4f42_9F1E_3B0DF280308D__INCLUDED_
#define EA_06B8EBB7_4E18_4f42_9F1E_3B0DF280308D__INCLUDED_

class FolderItem{

public:
FolderItem(int i);
virtual ~FolderItem();
};
#endif
I try to run this code and get following errors:

ContentManager error LNK2001: unresolved external symbol "void __cdecl
operator delete(void *)" (??3@$$FYAXPAX@Z)
ContentManager error LNK2001: unresolved external symbol "void
__stdcall `eh vector destructor iterator'(void *,unsigned int,int,void
(__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
ContentManager fatal error LNK1120: 2 unresolved externals

If I put constructor / destructor inside header file, compilation
successes.
Is somebody know the type of the problem ?

If the above suggestion doesn't work, try building the following, in a
single .cpp file without any headers:

class FolderItem{
public:
FolderItem(int i);
virtual ~FolderItem();
};

FolderItem::FolderItem(int) { }
FolderItem::~FolderItem() { }

int main()
{
FolderItem f(0);
}

If that works, there appears to be some problem with how you've set up
your project - there is no C++ problem with your code. But if the .NET
stuff is the problem, you'll probably get better help on a Microsoft
newsgroup.

Best regards,

Tom
Thank you, I will try to post this quetion in Microsoft group.

Aug 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
1
by: Tim | last post by:
I am just creating a hellow world program and it gave me these errors. can you help me out how to resolve this? Thanks, Tim #include <iostream> using namespace std;
10
by: Bil Muh | last post by:
Hello Developers, I use VC++ .NET v2003. By using Windows Forms .NET, I am developing an application which will work with TCP/IP functions. I can Build my application in Debug Mode normally, but,...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
4
by: Aaron Queenan | last post by:
When I build a C++ library to .NET using the managed C++ compiler, I get the following error message: Linking... LINK : error LNK2020: unresolved token (0A000005) _CrtDbgReport LINK : error...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
6
by: kml | last post by:
do anyone there know how to solve fatal error LNK2001 and LNK1120?? I am using Microsoft Visual 6.0
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.