htmlcxx is in C ++ parse html format of the data third-party libraries, but this stock in the following Bug, Bug will be given and solutions I encountered during use, please read my blog C ++ library html parsing tool of reptiles htmlcxx (attached VS2019 environment to build detailed process) , introduced htmlcxx local project build process, as well as environmental vs build process.
1 error, 17-line error util.cc file "constants have line breaks" when you compile the project htmlcxx
Solution: 17 util.cc the line of ""
constant Delete, and then key again ""
.
The reason is that it contains an invisible line breaks in the 0.86 version.
2 error, Development projects using errorLNK2038 检测到“RuntimeLibrary”的不匹配项: 值“MTd_StaticDebug”不匹配值“MDd_DynamicDebug”(HttpUtils.obj 中) 京东方在线爬虫 E:\Projects\Vistual Studio Projects\京东方在线爬虫\htmlcxx.lib(Node.obj) 1
This is because the local compile htmlcxx
way to use the default runtime project is 多线程调试 (/MTd)
, in vs the project default runtime mode used多线程调试 DLL (/MDd)
Solution: The htmlcxx
project was compiled before the amendment 多线程调试 DLL (/MDd)
, and then compile or runtime to modify the use of htmlcxx way 多线程调试 (/MTd)
,
.
Modify the method runtime mode project:
Modify its properties -> Configuration Properties -> C / C + ±> Code Generation -> Runtime
Error 3: Resolve html
when error will complainExpression:c>=-1&&c<=255
The reason is that the Chinese html occurred, there is a code value determination method will be the ASCII character, in which case the Chinese operation range, an error is reported.
Solution: Add code before parsing htmlsetlocale(LC_ALL, ".OCP");
More than three error solution I have been met, that much is tears. . .
Hope you can help to addicts, these Bug may have been tossing a few hours to see this blog enlightened, not a point to praise too dung Ha ~