Newbie’s Guide to getting Touchlib to compile.
Jan 6 2007
FOLLOW THESE INSTRUCTIONS AT YOUR OWN RISK!
I am completely new to C++ so it took me a while to get Touchlib to compile, below is a rough “how-to” which will hopefully make the process a little easier for you.
**************************************************************
// Download Files
**************************************************************
Download Visual c++ 2005 Express edition
Download Latest Platform SDK
Download Latest DirectX SDK
Download Open CV
Download VideoWrapper
Download DSVL
Install or Unzip everything into sensible directories
**************************************************************
// Easy way to install the Platform SDK for Visual c++ express
**************************************************************
Visual Studio 2005 Express needs some modification in order to get it working correctly.
Create a directory called “PlatformSDK” under “Program FilesMicrosoft Visual Studio 8VC”
Then copy the “bin”, “include”, and “lib” directory from the PSDK installation directory into this new directory.
**************************************************************
// Add Environment Variables
**************************************************************
Right click “My Computer” and go to “properties”, click the “advanced” tab, and select “Environment Variables”.
Create a New variable for DSVL_HOME with a value of the DSVL installation directory (eg c:multitouchdsvl).
Repeat for VIDEOWRAPPER_HOME.
Repeat for OPENCV_HOME.
**************************************************************
// Modify altbase.h to work with Visual c++ express
**************************************************************
For now you have to edit a couple files to remove a couple errors.
Taken from http://dev.openwengo.com/trac/openwengo/trac.cgi/wiki/HowToBuildFromSourceNgVs2005
edit “C:Program FilesMicrosoft Visual Studio 8VCPlatformSDKIncludeatlatlbase.h” (or “c:Program FilesPlatform SDKincludeatlatlbase.h")
Go to around line 287 and comment out the following:
============================================
/*
PVOID __stdcall __AllocStdCallThunk(VOID);
VOID __stdcall __FreeStdCallThunk(PVOID);
#define AllocStdCallThunk() __AllocStdCallThunk()
#define FreeStdCallThunk(p) __FreeStdCallThunk(p)
#pragma comment(lib, “atlthunk.lib")
*/
============================================
And now add the following replacement definition:
============================================
// workaround for not having atlthunk.lib in PSDK or VC++ 2005 Express Edition
#define AllocStdCallThunk() HeapAlloc(GetProcessHeap(),0,sizeof(_stdcallthunk))
#define FreeStdCallThunk(p) HeapFree(GetProcessHeap(), 0, p)
============================================
Error fixed: link error missing atlthunk.lib when building PhApi.dll
Explanation: atlthunk.lib is only delivered with the full version of Visual Studio 2005. However, if ATL classes are not used the workaround described above enables to compile and link correctly.
See the following links for more details:
http://forums.microsoft.com/msdn/showpost.aspx?postid=64509&siteid=1
http://resources.kairo.at/mozilla/build/make-win-tinderbox-vc8express.html
**************************************************************
// Modify ctlutil.h because there is an error in its code???
**************************************************************
Taken from (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=63785&SiteID=1)
Edit C:Program FilesMicrosoft Platform SDKSamplesMultimediaDirectShowBaseClasses/ctlutil.h
Go to line 278
============================================
private:
// Prevent bugs from constructing from LONG (which gets
// converted to double and then multiplied by 10000000
COARefTime(LONG);
operator=(LONG);
};
============================================
and change
============================================
operator=(LONG);
============================================
to
============================================
COARefTime& operator=(LONG);
============================================
**************************************************************
// Add the include directories
**************************************************************
Now you need to put a few include directories.
Open up the touchlib solution.sln. Right click the “touchlib” in the solution explorer, and click properties. Go to C++ tree and click “general”, then click “additional Include Directories” and add:
DirectX include directory (eg “C:Program FilesMicrosoft DirectX SDK (December 2006)Include")
C:Program FilesMicrosoft Platform SDKSamplesMultimediaDirectShowBaseClasses
C:Program FilesMicrosoft Visual Studio 8VCPlatformSDKIncludeatl
**************************************************************
// Now it should compile!
**************************************************************