C + + uses Htmlcxx to parse HTML content (vs. compile library file)

Source: Internet
Author: User

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;tree

Attached htmlcxx study materials: http://blog.csdn.net/youfangyuan/article/details/7816518

C + + uses Htmlcxx to parse HTML content (vs. compile library file)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.