Hey all. I've downloaded and moved the Xerces (v3.1.1) source here: /usr/include/xerces and I can see the source in the project explorer like this:
MyCppProject
Binaries
Includes
[...] // some other directories
开发者_开发知识库xerces
dom
[...] // some other directories
And, here's my simple C++ code:
#include <xercesc/util/PlatformUtils.hpp>
using namespace xercesc;
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
try {
XMLPlatformUtils::Initialize();
}
catch (const XMLException& toCatch) {
return 1;
}
XMLPlatformUtils::Terminate();
return 0;
}
And, here's the error that I get (along with others that are caused by this file not being included):
../main.cpp:1:42: error: xercesc/util/PlatformUtils.hpp: No such file or directory
What I don't understand is how the relative paths work in the source file. When I say type
#include <xercesc/util/PlatformUtils.hpp>
where is it looking, if not on the include paths already listed in the project explorer?From what you state in your question it looks like your using the folder name 'xercesc' instead of 'xerces' in your include path.
try
#include <xerces/util/PlatformUtils.hpp>
The include directive will look in all of the directories in the include path and try to find the file specified. So if you specified a folder c:/something/include
in your include path. it would search for c:/something/include/xercesc/util/PlatformUtils.hpp
.
If your file can't be found then you need to check the include paths being used.
精彩评论