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

LNK2020 unresolved token error

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.