Q: What are these cstddef, cctype, etc., files and why can't my compiler find them?
When I try to compile a VR Juggler 1.1 application, I get compiler errors because headers such as cstddef, cstdlib, cctype, etc. are not found. What are these files, and why can't my compiler find them?
A: Some compilers do not have all the standard C++ headers, so you must add -I$VJ_BASE_DIR/include/boost/compatibility/cpp_c_headers when compiling.
The C++ standard defines headers used to include old C headers such as stdlib.h and ctype.h. They are named based on the C header with the prefix "c" and no ".h" extension. Not all compilers (most notably, SGI's MIPSpro Compilers) have these headers. The Boost software library ( http://www.boost.org/ ) makes use of these headers since they are part of the C++ standard. To deal with those compilers that do not ship with the headers in question, Boost commes with a compatibility directory that you can add to your compile line. If you are using the version of Boost that comes with VR Juggler 1.½.0, just add the following to your C++ compiler flags:
-I$VJ_BASE_DIR/include/boost/compatibility/cpp_c_headers
Better yet, use the vrjuggler-config script to get the list of compiler arguments. It will give you the arguments needed that are appropriate for the compiler you are using. To use this script in a GNU makefile, simply add the following:
CXXFLAGS= $(shell vrjuggler-config --cxxflags)
If you're not using GNU make, use the following:
CXXFLAGS= `vrjuggler-config --cxxflags`
For this to work, you must have $VJ_BASE_DIR/bin in your path. (This is required if you are trying to compile any of the sample applications that come with VR Juggler 1.1 and 2.0.)
Back to: LiveFaq
