Hunter的大杂烩 技术学习笔记

December 2, 2010

PCRE 8.10 build on windows

Filed under: 技术话题 — hunter @ 12:25 pm

参考:http://blog.csdn.net/jollyjumper/archive/2010/06/28/5700024.aspx

1)config.h.generic->config.h,手动编辑其中的宏设置。在vc6下需要将HAVE_STDINT_H,HAVE_INTTYPES_H宏设为0。要让config.h中设置生效,需在工程中定义HAVE_CONFIG_H宏。
2)pcre.h.generic->pcre.h
3)如果使用默认的本地化字符表:pcre_chartables.c.dist->pcre_chartables.c
如要要生成新的pcre_chartables.c,单独编译dftables.c(注意如要让config.h生效定义HAVE_CONFIG_H宏),然后以参数pcre_chartables.c运行即可生成。还可以使用dftables的L选项。
4)在工程中添加:
config.h
pcre.h
pcre_internal.h
ucp.h

pcre_printint.src

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_info.c
pcre_maketables.c
pcre_newline.c
pcre_ord2utf8.c
pcre_refcount.c
pcre_study.c
pcre_tables.c
pcre_try_flipped.c
pcre_ucd.c
pcre_valid_utf8.c
pcre_version.c
pcre_xclass.c

如果创建的VC2008项目是静态库,则需要增加两个宏
HAVE_CONFIG_H
PCRE_STATIC

编译pcretest项目时,需要增加3个宏
HAVE_CONFIG_H
PCRE_STATIC
NOPOSIX

否则会出现诸如
pcretest.obj : error LNK2019: unresolved external symbol __imp__pcre_compile referenced in function _main
的错误

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress