All of Total Phase's products include a royalty-free C API. While this article uses the Aardvark adapter's C API as an example, the same information can be applied to the C APIs for the Beagle analyzers and the Cheetah adapter.
The MSVC++ compiler has a feature which pre-compiles header files to speed up compilation time. The header file stdafx.h centralizes all the pre-compiled data into one place. Normally, MFC applications requires that #include "stdafx.h" be added to each source file that requires these headers.
The Aardvark API is not an MFC C++ library, and thus should not be precompiled. Therefore, the aardvark.h file should not be added to stdafx.h.
To specify that aardvark.h not be precompiled by Visual C++, do the following:
Using Visual Studio 6
- Add aardvark.c and aardvark.h to your Visual Studio project
- Go to Project | Settings...
- "Settings for" should show the project you are building
- Expand "Source Files" on the left
- Select "aardvark.c" by clicking once
- On the right, select the C/C++ tab
- In the "Category" box, select "Precompiled Headers"
- Select "Not using precompiled headers"
- Click OK to close the dialog
Using Visual Studio .NET
- Add aardvark.c and aardvark.h to your Visual Studio project
- Go to the "Solution Explorer" (Ctrl + Alt + L)
- Expand "Source Files"
- Right-click "aardvark.c"
- Select the "Properties" option
- In the "Configuration" drop-down box select "All configurations"
- Set the "Create/Use Precompiled Header" option to "Not using precompiled headers"
- Click OK to close the dialog
Now, simply add #include "aardvark.h" in any source file that requires the Aardvark API.