编译链接htmlcxx动态库的时候报错,expected‘;before‘-'token,提示第三方库htmlcxx中ParseSax.tcc文件有错误????
我是在linux系统之下安装的htmlcxx库,然后自己编写了一个模块,编译命令如下:
g++ -fPIC -shared -o mod_proxy_logon.so mod_proxy_logon.cpp -I/usr/local/apache/include -I/usr/local/apr/include/apr-1 -I/usr/local/apr-util/include/apr-1 -lssl -lcurl -lhtmlcxx -lfuser
具体报错情况如下:
/usr/local/include/htmlcxx/html/ParserSax.tcc: In member function
‘void htmlcxx::HTML::ParserSax::parse(_Iterator&, _Iterator&, std::forward_iterator_tag)’:
/usr/local/include/htmlcxx/html/ParserSax.tcc:61: 错误:expected identifier before ‘-’ token
/usr/local/include/htmlcxx/html/ParserSax.tcc:61: 错误:expected ‘;’ before ‘-’ token
/usr/local/include/htmlcxx/html/ParserSax.tcc:226: 错误:expected `;' before ‘:’ token
我找到提示错误文件,看到61行和226行所在的代码如下:
if (c == end){
if (c != begin) this->parseContent(begin, c);
goto DONE; //此处为第61行
}
。。。。。。。
。。。。。。。
}
DONE: //此处为第226行
this->endParsing();
return;
换过了几个htmlcxx的版本都是报同样的错误,有没有哪位知道到底是哪里出问题了呢?请不吝赐教啊,拜托啦!!!
[解决办法]
可能是你调用的第三方库使用的函数名与你编写的函数或者其他要调用的函数库的代码中有命名冲突,这很正常,改下名字即可