this is a really basic question. I've been learning C++ and thus far I have only used the standard library. I have been including things like <iostream>
and with no problems. Now I want to use Apache Xerces, so I've installed it on my machine (a Debian system) and am following a tutorial which says I need to include:
#include <xercesc/sax2/SAX2XMLReader.hpp>
but g++ says "error: xercesc/sax2/SAX2XMLReader.hpp: No such file or directory". Where is it looking? Do I need to give it more information?
Thanks.
Use the --verbose
option:
[...]
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../include/c++/4.4.2
/usr/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../include/c++/4.4.2/i686-pc-linux-gnu
/usr/lib/gcc/i686-pc-linux-gnu/4.4.2/../../../../include/c++/4.4.2/backward
/usr/local/include
/usr/lib/gcc/i686-pc-linux-gnu/4.4.2/include
/usr/lib/gcc/i686-pc-linux-gnu/4.4.2/include-fixed
/usr/include
End of search list.
[...]
You can use the -I
option to add search directories, as explained here: http://gcc.gnu.org/onlinedocs/gcc-4.4.3/gcc/Directory-Options.html#Directory-Options
You can also use environment variables to change this permanently: http://gcc.gnu.org/onlinedocs/gcc-4.4.3/gcc/Environment-Variables.html#Environment-Variables
In your case, you could use CPLUS_INCLUDE_PATH
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With