Hi folks,
I'm new to C++, although quite proficient in MATLAB. Gone through tutorials, done hello world and variations...
But.. I'm trying to write some code to use Xerces C++ XML parser source, but am getting conflicting feedback whether the include file is found or not in the include path. I'm using NetBeans 7 IDE, updated today.
What I've done so far is download Xerces, extract to '/usr/local/include/xerces-c-3.1.1' and ran ./configure. Also, I added '/usr/local/include/xerces-c-3.1.1/src' to NetBeans' tools>options>code assistance>C++>Include folders.
Here's my code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
#include <xercesc/util/PlatformUtils.hpp>
using namespace xercesc;
int main(int argc, char* argv[])
{
try {
XMLPlatformUtils::Initialize();
}
catch (const XMLException& toCatch) {
// bad init
return 1;
}
XMLPlatformUtils::Terminate();
return 0;
}
|
When building, I get the error at line 1:
"main.cpp:1:42: fatal error: xercesc/util/PlatformUtils.hpp: No such file or directory"
what is confusing to me is that obviously netbeans sees the file, because if I hold ctrl and click on line 1, NetBeans opens up PlatformUtils.hpp in another tab. so, that header is obviously being found by NB, but I'm not sure why it throws an error during build?
Previously I had not properly put the xerces files in the right include path, and I was also seeing errors on line 2, because namespace wasn't properly defined. However, I know the include path must be set correctly because those code warnings are gone too.
any ideas why netbeans sees the file and can open it in the IDE, but fails to build claiming it is not there?
Thanks,
Brian