使用 boost::sregex_token_iterator 时出错
Posted
技术标签:
【中文标题】使用 boost::sregex_token_iterator 时出错【英文标题】:error while working with boost::sregex_token_iterator 【发布时间】:2013-01-29 23:05:09 【问题描述】:我想搜索一个正则表达式并用颜色打印它。我使用 boost::sregex_token_iterator 来做到这一点。这是我的代码
boost::regex re("ab.");
string s="";
string buf;
string infile("retest.txt");
//string color="green";
ifstream in(infile.c_str());
int lcount=0;
while (getline(in,buf))
boost::sregex_token_iterator p(buf.begin(), buf.end(), re, 0);
boost::sregex_token_iterator end;
lcount++;
cout <<"line : "<<lcount<<endl;
for (;p != end;++p)
string m(p->first, p->second);
cout<< m <<endl;
//cout <<*(p->first)<<endl;
//cout <<*(p->second)<<endl;
//unsigned int pos = buf.find(m);
buf = buf.insert(p->first,"\e[0;32m");
buf = buf.insert(p->second+m.length()+7,"\e[0m");
cout<<"\n";
s.append(buf);
s.append("\n");
in.close();
cout <<"s is: "<<s<<endl;
return 0;
但我收到此错误:
在 /usr/include/boost/config.hpp:35:0 包含的文件中, 来自 /usr/include/boost/regex/config.hpp:53, 来自 /usr/include/boost/regex.hpp:28, 来自 main3.cc:3: /usr/include/boost/config/compiler/gcc.hpp:92:7: 警告:#warning “未知编译器版本 - 请运行配置测试并报告结果” [-Wcpp] main3.cc:在函数âint main(int, char**)â中: main3.cc:36:40: 错误: 没有匹配函数调用 âstd::basic_string::insert(const __gnu_cxx::__normal_iterator >&, const char [8])â main3.cc:36:40:注意:候选人是: 在 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/string:54:0 包含的文件中, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/locale_classes.h:42, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/ios_base.h:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40, 来自 main3.cc:1: /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1182:7 : 注意: void std::basic_string<_chart _traits _alloc>::insert(std::basic_string<_chart _traits _alloc>::iterator, std::basic_string<_chart _traits _alloc>::size_type, _CharT ) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_chart _traits _alloc>::iterator = __gnu_cxx::__normal_iterator >;类型名 _Alloc::rebind<_chart>::other::pointer = char*; std::basic_string<_chart _traits _alloc>::size_type = unsigned int] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1182:7 :注意:候选人需要 3 个参数,提供 2 个参数 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1199:9 : 注意: 模板 void std::basic_string::insert(std::basic_string<_chart _traits _alloc>::iterator, _InputIterator, _InputIterator) [with _InputIterator = _InputIterator; _CharT = 字符; _Traits = std::char_traits; _Alloc = std::allocator] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1199:9 :注意:模板参数扣除/替换失败: main3.cc:36:40: 注意: 不能转换 âp.boost::regex_token_iterator::operator-><:__normal_iterator>, char, boost::regex_traits, std::allocator >()->boost::sub_match <:__normal_iterator> >::.std::pair<:__normal_iterator>, __gnu_cxx::__normal_iterator >::firstâ (type âconst __gnu_cxx::__normal_iterator >â) 到 type âstd::basic_string::iterator 又名 __gnu_cxx::__normal_iterator >â 在 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/string:54:0 包含的文件中, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/locale_classes.h:42, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/ios_base.h:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40, 来自 main3.cc:1: /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1230:7 : 注意: std::basic_string<_chart _traits _alloc>& std::basic_string<_chart _traits _alloc>::insert(std::basic_string<_chart _traits _alloc>::size_type, const std::basic_string <_chart _traits _alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_chart _traits _alloc> = std::basic_string; std::basic_string<_chart _traits _alloc>::size_type = unsigned int] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1230:7 : 注意:参数 1 从 âconst __gnu_cxx::__normal_iterator >â 到 âstd::basic_string::size_type aka unsigned intâ 的已知转换 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1252:7 : 注意: std::basic_string<_chart _traits _alloc>& std::basic_string<_chart _traits _alloc>::insert(std::basic_string<_chart _traits _alloc>::size_type, const std::basic_string <_chart _traits _alloc>&, std::basic_string<_chart _traits _alloc>::size_type, std::basic_string<_chart _traits _alloc>::size_type) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_chart _traits _alloc> = std::basic_string; std::basic_string<_chart _traits _alloc>::size_type = unsigned int] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1252:7 :注意:候选人需要 4 个参数,提供 2 个 在 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/string:55:0 中包含的文件中, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/locale_classes.h:42, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/ios_base.h:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40, 来自 main3.cc:1: /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.tcc:361:6 : 注意: std::basic_string<_chart _traits _alloc>& std::basic_string<_chart _traits _alloc>::insert(std::basic_string<_chart _traits _alloc>::size_type, const _CharT*, std ::basic_string<_chart _traits _alloc>::size_type) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_chart _traits _alloc>::size_type = unsigned int] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.tcc:361:6 :注意:候选人需要 3 个参数,提供 2 个参数 在 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/string:54:0 包含的文件中, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/locale_classes.h:42, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/ios_base.h:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40, 来自 main3.cc:1: /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1293:7 : 注意: std::basic_string<_chart _traits _alloc>& std::basic_string<_chart _traits _alloc>::insert(std::basic_string<_chart _traits _alloc>::size_type, const _CharT*) [与_CharT = char; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_chart _traits _alloc> = std::basic_string; std::basic_string<_chart _traits _alloc>::size_type = unsigned int] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1293:7 : 注意:参数 1 从 âconst __gnu_cxx::__normal_iterator >â 到 âstd::basic_string::size_type aka unsigned intâ 的已知转换 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1316:7 : 注意: std::basic_string<_chart _traits _alloc>& std::basic_string<_chart _traits _alloc>::insert(std::basic_string<_chart _traits _alloc>::size_type, std::basic_string::size_type, _CharT) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_chart _traits _alloc> = std::basic_string; std::basic_string<_chart _traits _alloc>::size_type = unsigned int] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1316:7 :注意:候选人需要 3 个参数,提供 2 个参数 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1334:7 : 注意: std::basic_string<_chart _traits _alloc>::iterator std::basic_string<_chart _traits _alloc>::insert(std::basic_string<_chart _traits _alloc>::iterator, _CharT) [与_CharT = char; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_chart _traits _alloc>::iterator = __gnu_cxx::__normal_iterator >;类型名 _Alloc::rebind<_chart>::other::pointer = char*] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1334:7 : 注意:没有已知的参数 1 从âconst __gnu_cxx::__normal_iterator >â 到âstd::basic_string::iterator aka __gnu_cxx::__normal_iterator >â 的转换 main3.cc:37:51: 错误:没有匹配的函数调用 âstd::basic_string::insert(__gnu_cxx::__normal_iterator >, const char [5])â main3.cc:37:51:注意:候选人是: 在 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/string:54:0 包含的文件中, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/locale_classes.h:42, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/ios_base.h:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40, 来自 main3.cc:1: /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1182:7 : 注意: void std::basic_string<_chart _traits _alloc>::insert(std::basic_string<_chart _traits _alloc>::iterator, std::basic_string<_chart _traits _alloc>::size_type, _CharT ) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_chart _traits _alloc>::iterator = __gnu_cxx::__normal_iterator >;类型名 _Alloc::rebind<_chart>::other::pointer = char*; std::basic_string<_chart _traits _alloc>::size_type = unsigned int] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1182:7 :注意:候选人需要 3 个参数,提供 2 个参数 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1199:9 : 注意: 模板 void std::basic_string::insert(std::basic_string<_chart _traits _alloc>::iterator, _InputIterator, _InputIterator) [with _InputIterator = _InputIterator; _CharT = 字符; _Traits = std::char_traits; _Alloc = std::allocator] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1199:9 :注意:模板参数扣除/替换失败: main3.cc:37:51: 注意: 不能转换 âp.boost::regex_token_iterator::operator-><:__normal_iterator>, char, boost::regex_traits, std::allocator >()->boost::sub_match <:__normal_iterator> >::.std::pair<:__normal_iterator>, __gnu_cxx::__normal_iterator >::second.__gnu_cxx::__normal_iterator<_iterator _container>::operator+ >((* &(( __gnu_cxx::__normal_iterator >::difference_type)m.std::basic_string<_chart _traits>Alloc>::length, std::allocator >())))。_gnu_cxx::__normal_iterator<_iterator _container>::operator+ >((* &7))â (type â__gnu_cxx::__normal_iterator >â) 到 type âstd::basic_string::iterator aka __gnu_cxx::__normal_iterator >â 在 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/string:54:0 包含的文件中, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/locale_classes.h:42, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/ios_base.h:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40, 来自 main3.cc:1: /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1230:7 : 注意: std::basic_string<_chart _traits _alloc>& std::basic_string<_chart _traits _alloc>::insert(std::basic_string<_chart _traits _alloc>::size_type, const std::basic_string <_chart _traits _alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_chart _traits _alloc> = std::basic_string; std::basic_string<_chart _traits _alloc>::size_type = unsigned int] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1230:7 : 注意:没有已知的参数 1 从â__gnu_cxx::__normal_iterator >â 到âstd::basic_string::size_type aka unsigned intâ 的转换 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1252:7 : 注意: std::basic_string<_chart _traits _alloc>& std::basic_string<_chart _traits _alloc>::insert(std::basic_string<_chart _traits _alloc>::size_type, const std::basic_string <_chart _traits _alloc>&, std::basic_string<_chart _traits _alloc>::size_type, std::basic_string<_chart _traits _alloc>::size_type) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_chart _traits _alloc> = std::basic_string; std::basic_string<_chart _traits _alloc>::size_type = unsigned int] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1252:7 :注意:候选人需要 4 个参数,提供 2 个 在 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/string:55:0 中包含的文件中, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/locale_classes.h:42, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/ios_base.h:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40, 来自 main3.cc:1: /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.tcc:361:6 : 注意: std::basic_string<_chart _traits _alloc>& std::basic_string<_chart _traits _alloc>::insert(std::basic_string<_chart _traits _alloc>::size_type, const _CharT*, std ::basic_string<_chart _traits _alloc>::size_type) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_chart _traits _alloc>::size_type = unsigned int] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.tcc:361:6 :注意:候选人需要 3 个参数,提供 2 个参数 在 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/string:54:0 包含的文件中, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/locale_classes.h:42, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/ios_base.h:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ios:43, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/ostream:40, 来自/usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/iostream:40, 来自 main3.cc:1: /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1293:7 : 注意: std::basic_string<_chart _traits _alloc>& std::basic_string<_chart _traits _alloc>::insert(std::basic_string<_chart _traits _alloc>::size_type, const _CharT*) [与_CharT = char; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_chart _traits _alloc> = std::basic_string; std::basic_string<_chart _traits _alloc>::size_type = unsigned int] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1293:7 : 注意:没有已知的参数 1 从â__gnu_cxx::__normal_iterator >â 到âstd::basic_string::size_type aka unsigned intâ 的转换 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1316:7 : 注意: std::basic_string<_chart _traits _alloc>& std::basic_string<_chart _traits _alloc>::insert(std::basic_string<_chart _traits _alloc>::size_type, std::basic_string::size_type, _CharT) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_chart _traits _alloc> = std::basic_string; std::basic_string<_chart _traits _alloc>::size_type = unsigned int] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1316:7 :注意:候选人需要 3 个参数,提供 2 个参数 /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1334:7 : 注意: std::basic_string<_chart _traits _alloc>::iterator std::basic_string<_chart _traits _alloc>::insert(std::basic_string<_chart _traits _alloc>::iterator, _CharT) [与_CharT = char; _Traits = std::char_traits; _Alloc = std::allocator; std::basic_string<_chart _traits _alloc>::iterator = __gnu_cxx::__normal_iterator >;类型名 _Alloc::rebind<_chart>::other::pointer = char*] /usr/local/lib/gcc/i686-pc-linux-gnu/4.7.2/../../../../include/c++/4.7.2/bits/basic_string.h:1334:7 : 注意:没有已知的参数 1 从 â__gnu_cxx::__normal_iterator >â 到 âstd::basic_string::iterator aka __gnu_cxx::__normal_iterator >â
的转换
我知道p->first
的类型不是插入函数接受的类型。但我不知道如何将它们相互转换。
【问题讨论】:
风格点,除非你有理由使用后增量,否则总是使用前增量(++lcount)。 你剪掉错误信息了吗? @alex 感谢您的提示。我是 c++ 新手。 “剪断错误”到底是什么意思? 您是否复制并粘贴了整个错误?好像少了一点。 哦,是的。我剪断了错误输出。它太长了,我认为我提到的部分是最重要的部分。我遇到了这样的错误,每次我都会想出一个解决方案,但这一次有点不同:) 【参考方案1】:问题可能是您对std::string::insert
的使用。在它的众多重载中,我看不到一个 insert(iterator, string) 版本。
您可能想通过明确说明 char 数组的长度来调用所需的版本:
void insert (iterator p, size_t n, char c)
【讨论】:
【参考方案2】:问题似乎是 boost 被配置为与不同版本的编译器一起使用,而不是您当前使用的编译器。
您能否也添加有关如何编译它的详细信息?
【讨论】:
你说得对,我的 boost 配置有误,我可以通过我的老板解决它! 编译器版本问题只会产生警告,因此可能不是原因。以上是关于使用 boost::sregex_token_iterator 时出错的主要内容,如果未能解决你的问题,请参考以下文章
在使用加载数据流步骤的猪中,使用(使用 PigStorage)和不使用它有啥区别?
Qt静态编译时使用OpenSSL有三种方式(不使用,动态使用,静态使用,默认是动态使用)