Tuesday, September 29, 2009

Configuring ARToolKit on Visual Studio 2008/Visual C++ and Windows 7

On this second post we will configure and run ARToolKit on Windows 7 and Visual Studio 2008/Visual C++

If you followed my last post you should have Visual C++ up and running and a API folder inside your user folder, if not then go ahead and do that. If you have Visual C++ up and running just keep on reading.

Software Versions used:
  • Visual Studio 2008/Visual C++
  • ARToolKit 2.71.1 32bits
  • Windows 7 Professional 64bits
Addicional Dependencies Required:
  • OpenGL/Glut libs
  1. Download ARToolKit's latest version: ARToolkit Download.
  2. Download Glut from this site and download the lastest version, at this time its glut 3.6 stable and 3.7beta so let's stick with v3.6. (OpenGL should come with Windows by default).
  3. Copy the glut32.lib to your system folder (C:\Windows\SySWoW64 on 64bit OS and C:\Windows\System32 on 32 bits OS)
  4. Download the glu/glut files for Visual C++ from here. Unpack it and copy the GL folder it to your includes folder under Visual Studio (defaults to C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include). Now copy the files inside lib to the VC lib directory (VC\lib).
  5. Now download msvcp71d.dll and msvcr71d.dll from dll-files.com http://www.dll-files.com/dllindex/dll-files.shtml?msvcp71d and http://www.dll-files.com/dllindex/dll-files.shtml?msvcr71d
  6. Unpack ARToolKit (recommended in any folder under your home). 
  7. Open the ARToolKit project with Visual C++ (ARToolKit/ARToolkit.sln) and follow the Wizard to update it to a 2008 project.
  8. Paste the msvcp and msvcr dlls to the ARToolKit\bin.
  9. Build the projects with Visual C++, it should build fine
Important Note: I am having issues running the samples from Visual Studio 2008, it gives me the following error at the console: "Camera Parameter Load Error !!". I suspect its related either to my web cam's driver or the fact that its a built-in notebook webcam, any new info regarding this issue will be posted. Executing the .exe directly from the /bin folder works fine.

Sources: ARToolkit documentation and Maxwell Anderson's blog (pt_br): http://maxwellanderson.wordpress.com/2009/05/28/configurando-o-artoolkit-e-a-openvrml-no-microsoft-visual-studio-2008-parte-12/

Configure and Build Havok Demos on Visual Studio 2008 and Windows 7 64bits

This post will try to explain step-by-step how to configure Visual Studio/Visual C++ and Windows 7 64bits to build Havok's Demo project. At time of post the following versions were used:
  • Visual Studio 2008
  • August 2009 DirectX SDK
  • Havok 6.5.0r1
  1. First lets download Visual C++ from Microsoft's web site and install it: Visual C++.
  2. Once we have that we need to install Microsoft's DirectX SDK so go ahead and download that: DirectX SDK.
  3. Once we have those we are ready to download Havok. Go to Havok's web site and submit the form to acess your download. 
  4. Unpack it. I recommend unpacking it to any subfolder under your user folder. This is because Visual C++ needs to write intermediate files after compiling and Windows 7 comes with folder acess rights restricted so if you unpack it under the file system folders you will have to set it so that Visual C++ can read/write on that. So go ahead and create a API folder inside Libraries -> Documents -> Visual Studio 2008.
  5. Open Visual C++ and open the Havok Demo Project (if you followed instructions should be at C:\Users\"UserName"\Documents\Visual Studio 2008\API\hk650r1\Demo\Demos\Demos_win32_9-0.vcproj
  6. Open project's properties (Project -> Properties (Atl-F7 by default)
  7. Click on Configuration Properties -> Linker -> General
  8. Inside the General tab select Addicional Library Dependencies and click on the button with "..." on the right end of the line to edit.
  9. Create a new line and browse to DirectX SDK dxguid.lib. If you installed it in it's default directory it should be in C:\Program Files (x86)\Microsoft DirectX SDK ( version ). The dxguid.lib is in Lib -> x86. Important: Even if you use 64bit system select the x86 folder. The dxguid.lib inside the x64 folder has givem me some incompatibility issues but the x86 works fine so far.
  10. Try to build/run your Demo, it should work fine.