#include <iostream>
#include <fstream>
#include <cstdlib>
#include <sstream>
#include <string>
#include <ParserDom.h>
using namespace std;
using namespace htmlcxx;
int main()
{
ifstream bucky;
string str="";
bucky.open("C:\\tasks\\TEST2.txt");
if(!bucky.is_open()){
exit(EXIT_FAILURE);
}
char word[50];
bucky >> word;
str.append(word);
str.append(" ");
while(bucky.good())
{
bucky >> word;
str.append(word);
str.append(" ");
}
//cout<< word<<" "<<endl;
bucky >> word;
str.append(word);
str.append(" ");
HTML::ParserDom parser;
tree<HTML::Node> dom = parser.parseTree(str);
//Print whole DOM tree
cout << dom << endl;
}
喜找到“strings.h”中以,我使用htmlcxx,我安装了它,包括它的头文件和库到我的项目,并写了我的代码如上 简单地说,我打开了一个html文件,将其放入字符串中,然后使用html解析器编写它。但我得到了以下错误:错误有关htmlcxx
c:\...\htmlcxx-0.84\html\parsersax.tcc(4): fatal error C1083: Cannot open include file: 'strings.h': No such file or directory
我知道你能不能帮我解决这个问题**
你的构建环境是什么? – 2013-03-20 00:02:48
在Microsoft Visual Studio C++中。我添加了#include的标题,但仍显示错误消息。问题是它找不到strings.h! –
user2188591
2013-03-20 18:43:01