Sign in to follow this  
Robert007

MUD Game Programming: Compilation error from VC2008 IDE

Recommended Posts

[PROBLEM SOLVED: I should have included all the ThreadLib files (*.h and *.cpp) into the new console project together with the Demo03-01.cpp.] I am new to this forum and trying my hands on source code that comes with book "MUD Game Programming". Specifically, I included "ThreadLib/ThreadLib.h" in VC++2008 Prof IDE to execute the Demo03-01.cpp - Basic Threading of the book. However I got the following link error:
1>------ Build started: Project: Demo03-01_ThreadingBasics, Configuration: Debug Win32 ------
1>Compiling...
1>Demo03-01.cpp
1>Linking...
1>Demo03-01.obj : error LNK2001: unresolved external symbol "class 
std::map<unsigned long,void *,struct std::less<unsigned long>,class 
std::allocator<struct std::pair<unsigned long const ,void *> > > 
ThreadLib::g_handlemap" 
(?g_handlemap@ThreadLib@@3V?$map@KPAXU?$less@K@std@@V?$allocator@U?$pair@$$CBKPA
X@std@@@2@@std@@A)
1>Demo03-01.obj : error LNK2019: unresolved external symbol "unsigned long
 __stdcall ThreadLib::DummyRun(void *)" (?DummyRun@ThreadLib@@YGKPAX@Z)
 referenced in function "unsigned long __cdecl ThreadLib::Create(void 
(__cdecl*)(void *),void *)" (?Create@ThreadLib@@YAKP6AXPAX@Z0@Z)
1>C:\UTM_MUD\Demos\Demo03-01_ThreadingBasics\Debug\Demo03-01_ThreadingBasics.exe : fatal error LNK1120: 
2 unresolved externals
1>Build log was saved at "file://c:\UTM_MUD\Demos\Demo03-01_ThreadingBasics
\Demo03-01_ThreadingBasics\Debug\BuildLog.htm"
1>Demo03-01_ThreadingBasics - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Could anyone know what is wrong? Thank you in advance. NOTE: I can run the original source code project with VC2008 successfully. The above error occurred in a new project after (1) I created a console program; (2) pasted the Demo03-01.cpp; (3) included the "ThreadLib/ThreadLib.h" into a new project. What did I miss? PROBLEM SOLVED: I should have included all the ThreadLib files (*.h and *.cpp) into the new console project together with the Demo03-01.cpp. [Edited by - Robert007 on July 23, 2009 8:36:04 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this