What this covers:
Adding in the DIGuy class into a Visual Studio project
What you'll need:
Visual Studio 2005 (yes, it has to be 2005)
DIGuy installed on your computer
If you want text to speech support:
SAPI 5.1 Speech SDK installed on your computer
Optional: the DIGuy class I wrote. This post mostly focuses on the project settings so you could just call DIGuy functions straight from your project, but I made the class as a wrapper to make things easier.
How to do it:
The hardest part to get right is project settings. There are a bunch of them! I will explain and put screenshots in.
1) Go to Project Settings>General. For Character Set, choose "Use Multi-Byte Character Set".
2) Go to C/C++ and add the following additional include directories:
$(DIGUY)\3rdparty\haptek\haptek_19991020\NT\Include
$(DIGUY)\include
$(DIGUY)\3rdparty\sgi\glut-3.6\include
C:\Program Files\Microsoft Speech SDK 5.1\Include
The $(DIGUY) means it's looking for an environment variable set on your computer. You can set that through right-clicking on My Computer, then clicking Properties. Go to the Advanced Tab, click Environment Variables, then under the System Variables section, click New. Let the variable name be DIGUY and the path be the path to where DIGuy is installed on your system. You might have to restart your computer for it to take effect.
Alternatively, you can replace the $(DIGUY) above with the path to DIGuy on your computer.
3) Go to Linker>General. Under Additional Library Directories, add:
"$(DIGUY)\3rdparty\haptek\haptek_19991020\NT\Include";"C:\Program Files\Microsoft Speech SDK 5.1\Lib\i386";"$(DIGUY)\lib\win32\vc8_md";"$(DIGUY)\3rdparty\sgi\glut-3.6\lib\win32\vc8_md";"$(DIGUY)\3rdparty\cygnus\pthreads-win32-20050103\lib\win32\i586_md_dll";"$(DIGUY)\3rdparty\trolltech\qt-3.3.8-win32\lib\win32\vc8_md_dll";"$(DIGUY)\3rdparty\activestate\AP822\lib\"
You should be able to just copy and paste that string; it'll make your life easier. You can see that each library directory is separated by a semicolon in case you'd want to type them in or add them individually.
4) Under Linker > Input, in the Additional Dependencies, add the following:
libdiguy_module_exface_ogl.lib hapapi.lib winmm.lib wsock32.lib netapi32.lib comctl32.lib opengl32.lib glu32.lib libdiguy.lib libdiguy_graphics_ogl.lib libdiguy_module_script_perl.lib libbdiglut.lib pthreadvc1.lib perl58_vc8_mdd.lib qt338_vc8_md.lib
Again, you should be able to copy and paste. These are separated by spaces, not semicolons, in case you'd want to type in individually.
5) If you compile now, you will see a LNK4098 warning:
If you try to fix it by ignoring the msvcrt library, you just get a bunch of linker errors. My research shows that it has something to do with mixing debug and release code libraries (probably somewhere deep in DIGuy) so I'd just leave the linker warning, since it compiles and works fine.
5) Now include your DIGuy code where you need it and you should be good to go!





No comments:
Post a Comment