1. Download htmlcxx,http://sourceforge.net/projects/htmlcxx/
2. Unzip the htmlcxx-0.85.tar.gz
3. Open Htmlcxx.vcproj, Note is htmlcxx.vcproj, not the following htmlcxxapp.vcproj
4. Use vs to open htmlcxx.vcproj, need to convert project
5. Choose the compilation mode: Debug or Release mode, specifically determined by the compilation mode of the project you need to use to the Htmlcxx library file, but note the debug to Debug,release to release, do not confuse
6. Right-click Htmlcxx, select Properties, you can see the runtime default is " multithreaded debugging/MTd":
7. When selecting the runtime, it is determined by the runtime of the project that needs to use the Htmlcxx library file , because my project uses "multithreaded debug DLL (/MDD)", so Select "Multithreaded Debug DLL (/MDD)" to compile
8. Error:
9. Troubleshooting:
Change into
10. In the developed project folder, create a new "Htmlcxx" file with two subfolders "Lib" and "include" added
11. Copy the compiled Htmlcxx.lib(debug or release, as determined by the Htmlcxx compilation mode) to the Lib folder. Add all. h header files and PARSERSAX.TCC in the HTML folder to the Include folder
12. Select the project properties of the project, add the library file Htmlcxx.lib to the project (add Htmlcxx.lib path in the Library directory under VC + + directory)
13. Add the following in the header file of the project you are developing:
#include <string> #include "htmlcxx/include/parserdom.h" using namespace std;using namespace Htmlcxx; #pragma Comment (lib, "Htmlcxx.lib")
14. Specific usage code:
void Nuistmoney::getlogweektxt () {if (logined==true) {logwidget->clear (); Lbmessage->settext (tr ("Querying for consumption this week, please wait ...")); QString data=gettoallnet (tr ("http://www.**************.com.cn")); string html=data.tostdstring (); HTML::P arserdom parser;treeAttached htmlcxx study materials: http://blog.csdn.net/youfangyuan/article/details/7816518
C + + uses Htmlcxx to parse HTML content (vs. compile library file)