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

LNK2020 unresolved token error

Hi, If I
1) create a brand new Visual C++ Project -> Class Library (.Net)
2) in the stdafx.h file add #include <atlbase.h>
I get the following errors:

------ Build started: Project: testATL, Configuration: Debug Win32
------

Compiling...
Stdafx.cpp
Compiling...
AssemblyInfo.cpp
testATL.cpp
Generating Code...
Linking...
LINK : error LNK2020: unresolved token (0A000018) ??_7type_info@@6B@
LINK : error LNK2020: unresolved token (0A000019) _CrtDbgReport
LINK : error LNK2020: unresolved token (0A00001B) _CxxThrowException
LINK : error LNK2020: unresolved token (0A00001F) memset
LINK : error LNK2020: unresolved token (0A000020) atexit
LINK : error LNK2020: unresolved token (0A000023) free
LINK : fatal error LNK1120: 6 unresolved externals

Build log was saved at "file://c:\temp\testATL\Debug\BuildLog.htm"
testATL - 7 error(s), 0 warning(s)
---------------------- Done ----------------------

Build: 0 succeeded, 1 failed, 0 skipped
Why is this?
Basically, I want to use existing code that uses CString, but I don't
want to use MFC. I wanted to use WTL or ATL instead.
Any suggestions as to what I can do?
Many thanks.
Nov 16 '05 #1
1 9076
Try linking to msvcrtd.lib for the debug version and msvcrt.lib for the
release version of your app.

Regards,

Thijs

"Tony Baker" <ba********@hotmail.com> schreef in bericht
news:2a**************************@posting.google.c om...
Hi, If I
1) create a brand new Visual C++ Project -> Class Library (.Net)
2) in the stdafx.h file add #include <atlbase.h>
I get the following errors:

------ Build started: Project: testATL, Configuration: Debug Win32
------

Compiling...
Stdafx.cpp
Compiling...
AssemblyInfo.cpp
testATL.cpp
Generating Code...
Linking...
LINK : error LNK2020: unresolved token (0A000018) ??_7type_info@@6B@
LINK : error LNK2020: unresolved token (0A000019) _CrtDbgReport
LINK : error LNK2020: unresolved token (0A00001B) _CxxThrowException
LINK : error LNK2020: unresolved token (0A00001F) memset
LINK : error LNK2020: unresolved token (0A000020) atexit
LINK : error LNK2020: unresolved token (0A000023) free
LINK : fatal error LNK1120: 6 unresolved externals

Build log was saved at "file://c:\temp\testATL\Debug\BuildLog.htm"
testATL - 7 error(s), 0 warning(s)
---------------------- Done ----------------------

Build: 0 succeeded, 1 failed, 0 skipped
Why is this?
Basically, I want to use existing code that uses CString, but I don't
want to use MFC. I wanted to use WTL or ATL instead.
Any suggestions as to what I can do?
Many thanks.

Nov 16 '05 #2

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

Similar topics

1
by: mccoyn | last post by:
I'm porting an old project to use .NET. When I try to link in a static library (.lib) that has a single managed class in it. I get the following errors: LINK : error LNK2020: unresolved token...
2
by: Jacob Cohen | last post by:
Under VC7.1, I am trying to wrap a native-C++ DLL that contains C++ objects in a Managed-C++ class library for use in a C# project. I created and compiled the native DLL under VC7.1 as a Win32...
3
by: Simon Jefferies | last post by:
Hello, I am trying to use a Managed C++ .NET (DLL) Class library within my Managed C++ .NET forms application. I have both projects in the same solution and have the class library under my...
2
by: Vickie | last post by:
I have a very simple program with some computations. After using NODEFAULTLIB to get rid of LNK2005 errors such as: LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in...
0
by: Stefan | last post by:
Hi, Could anyone share some light on this and how I can work around it. If I have 2 managed c++ dlls (A and B) and B tries to use a native class in A this fails to link. It is easily...
0
by: Gustavo L. Fabro | last post by:
Greetings! I found myself with a LNK2020 linking problem using VS.NET 2003 under a situation that I was able to replicate in a small project. I found one workaround for the problem too, but...
0
by: Roland | last post by:
Hi, ultimately I want to call some unmanaged C++ class that contains some DirectShow code of mine from my C# classes, but for the time being I'd be happy if I could get this to build! I have...
2
by: tllee | last post by:
I wrote a simple stack program using class template on VC++ 2003 but am unable to resolve the following link errors: LINK : error LNK2020: unresolved token (0A000046) Stack.__dtor LINK : error...
3
by: S Wheeler | last post by:
Hi - I have a vc++ WinForms app. Can I override the WndProc so I can send custom messages to my app. Is there any way to do this? I need to notify the main form of events from a library. How is...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.