Monday, December 29, 2008

compile htmlcxx 0.83 under windows xp windows编译htmlcxx

htmlcxx Version 0.83 xp sp3 VC2005 sp1

VC complains that parsersax.tcc missing "strings.h" which can't be included.
Searched mingw path, there is a "strings.h", but obviously, there isn't one in vc8.
Try compile htmlcxx 0.82, only one error was prompted.

>d:\libs\htmlcxx-0.83\html\utils.cc(17) : error C2001: newline in constant
>d:\libs\htmlcxx-0.83\html\utils.cc(18) : error C2144: syntax error : 'char' should be preceded by
';'
View this file with ecoding utf-8, the 17 line tells tells

const char*signature = "?";

But with cp936 encoding, this line turns into:

const char *signature = "锘?;

which leads to compile error.

Then, I compared parsersax.tcc in 0.83 and 0.82, only a few lines are different.


http://htmlcxx.cvs.sourceforge.net/viewvc/htmlcxx/htmlcxx/html/ParserSax.tcc?r1=1.4&r2=1.5







Then, I commented the include lines..

Later, I got a lib.

And, it could be used to compile htmlcxxapp app.

解决办法很简单,只要把那个报错的行给注释了就好了。这个头文件是linux才有的。windows vc没有。。

另外一个utils.cc文件,只要把行17 改成

const char *signature = "";

就好了。报错是因为原来的文件是utf编码。

No comments:

Post a Comment