【发布时间】:2010-09-28 06:29:52
【问题描述】:
我只有 1 行代码,这是:
pcrecpp::RE re("abc");
在函数OnBnClickedButtonGo() 中。而且这个函数在Release模式下会失败,但是在debug模式下可以正常使用。
(我在 Windows XP 上使用 Visual Studio 8。)
错误信息是:
A buffer overrun has occurred in testregex.exe which has corrupted the program's
internal state. Press Break to debug the program or Continue to terminate
the program.
For more details please see Help topic 'How to debug Buffer Overrun Issues'.
我怀疑它是它的析构函数,它是不可见的和隐含的......但我真的不知道。
PS:我静态链接到 PCRE lib 版本 7.8。
PS2:不是很相关,但可以帮助一些无法链接到 PCRE 库的人(我花了几个小时才整理出来):包括 #define PCRE_STATIC 行。
【问题讨论】:
-
你构建了这个库,还是一个罐头库?不管怎样,它是用同一个编译器编译的吗?如果没有,我会尝试使用您的编译器构建库,看看是否有帮助。
标签: destructor pcre buffer-overrun