Ubuntu 在gcc中运行tinyxml时出错

Ubuntu 在gcc中运行tinyxml时出错,ubuntu,tinyxml,Ubuntu,Tinyxml,我想通过一个C程序创建一个xml文件。我在ubuntu10.10中使用gcc和tinyxml #include"tinyxml.h" #define TIXML_USE_STL #include< tinyxml.h> void dump_to_stdout(const char* pFilename); int main() { dump_to_stdout("example1.xml"); return 0; } void dump_to_stdout(const char

我想通过一个C程序创建一个xml文件。我在ubuntu10.10中使用gcc和tinyxml

#include"tinyxml.h"
#define TIXML_USE_STL
#include< tinyxml.h>

void dump_to_stdout(const char* pFilename);

int main()
{
dump_to_stdout("example1.xml");
return 0;
}

void dump_to_stdout(const char* pFilename)
{
TiXmlDocument doc(pFilename);
bool loadOkay=doc.LoadFile();
if(loadOkay)
{printf("\n%s:\b",pFilename);
}
else
{printf("failed to load file \"%s\"\n",pFilename);
}
}
#包括“tinyxml.h”
#定义TIXML\u使用\u STL
#包括
无效转储到标准输出(常量字符*文件名);
int main()
{
转储到stdout(“example1.xml”);
返回0;
}
无效转储到标准输出(常量字符*文件名)
{
TiXmlDocument文件(pFilename);
bool loadok=doc.LoadFile();
如果(好的)
{printf(“\n%s:\b”,pFilename);
}
其他的
{printf(“未能加载文件\%s\”\n,pFilename);
}
}
生成的错误为:

divya@ubuntu:~/Desktop/Ccodes$gcc-cx2.c 在x2.c中包含的文件中:1: /usr/include/tinyxml.h:51:致命错误:字符串:没有这样的文件或目录 编译终止

tinyxml.h头在指定的位置上,但它表示没有这样的文件。 这里有什么问题吗

非常感谢您的帮助。

尝试添加
#定义TIXML_USE_STL
以供项目范围使用,或将其编辑到tinyxml.h的第一行