作者:手机用户2502920645 | 来源:互联网 | 2023-05-18 03:16
我是vxWorks新手,请教各位大虾如何解析xml文件,我用的完全是风河提供的例子,路径是WindRiver\components\webservices-1.6\tutorials\xml\exam
我是vxWorks新手,请教各位大虾如何解析xml文件,我用的完全是风河提供的例子,路径是WindRiver\components\webservices-1.6\tutorials\xml\examples\xpp的那个,编译路径也加入了WindRiver\components\webservices-1.6\h,但是编译通过后xppAlloc等函数无法解析,于是我把D:\WindRiver\components\webservices-1.6\src\xml里面的所有内容都拷贝进工程再编译,这次却因为xmldoc.c编译不过了,里面的函数为
XML_Parser XML_ParserCreate
(
const XML_Char *encodingName
)
{ }
错误提示包括 error (dcc:1173): compiler out of sync. Probably missing ';' or '}'
error (dcc:1056): illegal function definition和error (dcc:1633): parse error near 'XML_ParserCreate',我感觉说得是同一个事情,但是不知道为什么,没有语法错误啊,还是因为我没有把相应的头文件或源文件加入工程。
说实话,我也不知道直接把src中的文件都拷贝进工程对不对,到底应该怎么做。
我现在最想问的就是这么几点:
1 怎么样才能正常运行vx自带的解析xml的功能;
2 vx其他功能的使用中,估计也不是简单的把.h包含就行吧,那么怎样做才能让那些函数都能解析(感觉如果工程中没有.c文件就没法运行);
3 有没有哪位大虾有可用的xml解析函数,可以发给我用一下,比如移植的tinyxml等,小弟感激不尽
由于我实在是vx的新手,还请各位高手指点!
3 个解决方案
我记得每个示例文件头部的注释里面有提到需要包含哪几个.c文件才能编译成功,可能稍微有一点出入,你看下例子的注释先,不需要把所有的文件都包括进去
我按照你们说的编译还是有很多错误啊::
../xmlparse.c:716: error: 'ASCII_x' undeclared here (not in a function)
../xmlparse.c:716: error: 'ASCII_m' undeclared here (not in a function)
../xmlparse.c:716: error: 'ASCII_l' undeclared here (not in a function)
../xmlparse.c:716: error: 'ASCII_EQUALS' undeclared here (not in a function)
../xmlparse.c:716: error: 'ASCII_h' undeclared here (not in a function)
../xmlparse.c:716: error: 'ASCII_t' undeclared here (not in a function)
../xmlparse.c:716: error: 'ASCII_p' undeclared here (not in a function)
../xmlparse.c:717: error: 'ASCII_COLON' undeclared here (not in a function)
../xmlparse.c:717: error: 'ASCII_SLASH' undeclared here (not in a function)
这个是什么原因呢???