Pcrecpp析构函数

时间:2015-10-15 08:58:32

标签: regex string pcre

int main(int argc, char* argv[])
{
   std::string s1;
   pcrecpp::RE re("(.*)");
   re.PartialMatch("This is a test progream", &s1);

   return 0;
}

我想将匹配结果存储到s1,但是当我运行程序时,会发生错误:

Screen-shot of VS error message and code location

这是堆栈跟踪信息:

stack trace

pcrecpp版本: 8.36
编译器: vs2005

1 个答案:

答案 0 :(得分:0)

我找到了解决此问题的更好方法。由于pcrecpp.dll将malloc内存,这将导致Windows上的错误。所以,首先,我构建了pcre.dll;然后将pcrecpp文件添加到我的项目中,从而解决内存malloc问题。     以pcre.8.36为例:     1.使用pcre文件生成pcre.dll:

pcre_byte_order.c
pcre_chartables.c
pcre_compile.c
pcre_config.c
pcre_dfa_exec.c
pcre_exec.c
pcre_fullinfo.c
pcre_get.c
pcre_globals.c
pcre_jit_compile.c
pcre_maketables.c
pcre_newline.c
pcre_ord2utf8.c
pcre_refcount.c
pcre_string_utils.c
pcre_study.c
pcre_tables.c
pcre_ucd.c
pcre_valid_utf8.c
pcre_version.c
pcre_xclass.c

pcre.h
pcre_internal.h
ucp.h
config.h
  1. 添加

    pcre_scanner.cpp pcre_stringpiece.cpp pcrecpp.cpp pcre_scanner.h pcre_stringpiece.h pcrecpparg.h
    我的项目,好的!

相关问题