LNK2020 unresolved token error

T

Tony Baker

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

Thijs

Try linking to msvcrtd.lib for the debug version and msvcrt.lib for the
release version of your app.

Regards,

Thijs
 

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