JavaScript EditorFree JavaScript Editor     Ajax Editor 

Main Page
  Previous Section Next Section

Compiling the Programs

I wrote the code for this book with Microsoft Visual C++ 5.0/6.0. However, in most cases the programs will work with any Win32-compliant compiler. Nevertheless, I suggest Microsoft VC++ because it works the best for this type of work.

If you are unfamiliar with your compiler's IDE, you are going to be wildly lost compiling Windows programs. Please take the time to learn your way around the compiler, and at least know how to compile a "Hello World" console program or something similar before you dive into compiling the programs.

To compile Windows Win32 .EXE programs, you just need to set the target of your program project to Win32 .EXE and compile. However, to create DirectX programs, you must include the DirectX import libraries in your project. You may think that you can simply add the DirectX libraries to your include path, but that won't work! Save yourself a headache and include the DirectX .LIB files in your project or workspace manually. You can find the .LIB files in the LIB\ directory, right under the main DirectX SDK directory that you installed under. That way there won't be any linker confusion. In most cases, you'll need the following:

DDRAW.LIB DirectDraw import library
DINPUT.LIB DirectInput import library
DINPUT8.LIB DirectInput8 import library
DSOUND.LIB DirectSound import library
D3DIM.LIB Direct3D Immediate Mode import library
DXGUID.LIB DirectX GUID library
WINMM.LIB Windows Multimedia Extensions

I'll go into more detail on these files when you actually start working with them, but at least keep them in mind when you start getting "unresolved symbol" errors from your linker. I don't want any e-mails on this subject from rookies!

In addition to the DirectX .LIB files, you must include the DirectX .H header files in your header search path, so keep that in mind. Also, be sure to make the DirectX SDK directories first in the search path list, because many C++ compilers contain old versions of DirectX and the old headers might be found in the compiler's own INCLUDE\, which is wrong. The proper place is the DirectX SDK include directory, which is located in the main installation directory of the DirectX SDK in INCLUDE\.

Finally, if you use Borland products, make sure that you use the Borland versions of the DirectX .LIB files. They can be found in the BORLAND\ directory of the DirectX SDK installation.

      Previous Section Next Section

    JavaScript EditorAjax Editor     JavaScript Editor