PCRE Tutorial
Compile PCRE 8.12

Download PCRE 8.12 source code from http://pcre.org

You can download compiled PCRE 8.12 libs for win32 (MS Visual C++ 6.0)

1. Start → Run → cmd

c:\cmd.exe - PCRE Tutorial

2. Setting configuration:
copy config.h.generic config.h
write config.h

c:\cmd.exe - PCRE Tutorial

3. Copy next strings to the begin of config.h


4. Save config.h and do not close WordPad



5. Copy pcre.h
copy pcre.h.generic pcre.h

c:\cmd.exe - PCRE Tutorial

6. Compile dftables.c
cl -DHAVE_CONFIG_H dftables.c

c:\cmd.exe - PCRE Tutorial

We have errors. Edit config.h:
#define HAVE_STDINT_H 1 to
#define HAVE_STDINT_H 0

c:\cmd.exe - PCRE Tutorial

Edit config.h:
#define HAVE_INTTYPES_H 1 to
#define HAVE_INTTYPES_H 0

c:\cmd.exe - PCRE Tutorial

7. Generate a set of standard character tables:
dftables.exe pcre_chartables.c

c:\cmd.exe - PCRE Tutorial

8. Compile the following source files, setting -DHAVE_CONFIG_H as a compiler option
cl -DHAVE_CONFIG_H /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_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

c:\cmd.exe - PCRE Tutorial

9. Create dynamic library pcre.dll
link /DLL /OUT:pcre.dll pcre_chartables.obj pcre_compile.obj pcre_config.obj pcre_dfa_exec.obj pcre_exec.obj pcre_fullinfo.obj pcre_get.obj pcre_globals.obj pcre_info.obj pcre_maketables.obj pcre_newline.obj pcre_ord2utf8.obj pcre_refcount.obj pcre_study.obj pcre_tables.obj pcre_try_flipped.obj pcre_ucd.obj pcre_valid_utf8.obj pcre_version.obj pcre_xclass.obj

c:\cmd.exe - PCRE Tutorial

Copy files: pcre.dll, pcre.lib, pcre.exp to folder "pcre8.12 dll", for example.

10. Create dynamic library pcreposix.dll
cl -DHAVE_CONFIG_H /c pcreposix.c
link /DLL /OUT:pcreposix.dll pcreposix.obj pcre.lib

c:\cmd.exe - PCRE Tutorial

Copy files: pcreposix.dll, pcreposix.lib, pcreposix.exp to folder "pcre8.12 dll", for example.

11. Compile tools pcretest.exe and pcregrep.exe
cl -DHAVE_CONFIG_H pcretest.c pcre.lib pcreposix.lib
cl -DHAVE_CONFIG_H pcregrep.c pcre.lib
// if no unistd.h and dirent.h files, please delete same lines in config.h

c:\cmd.exe - PCRE Tutorial

12. Create static library pcre.lib and pcreposix.lib
Edit config.h:
/* #undef PCRE_STATIC */ to
#define PCRE_STATIC 1

cl -DHAVE_CONFIG_H /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_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

lib /OUT:pcre.lib pcre_chartables.obj pcre_compile.obj pcre_config.obj pcre_dfa_exec.obj pcre_exec.obj pcre_fullinfo.obj pcre_get.obj pcre_globals.obj pcre_info.obj pcre_maketables.obj pcre_newline.obj pcre_ord2utf8.obj pcre_refcount.obj pcre_study.obj pcre_tables.obj pcre_try_flipped.obj pcre_ucd.obj pcre_valid_utf8.obj pcre_version.obj pcre_xclass.obj

cl -DHAVE_CONFIG_H /c pcreposix.c

lib /OUT:pcreposix.lib pcreposix.obj

c:\cmd.exe - PCRE Tutorial

Copy files: pcre.lib, pcreposix.lib to folder "pcre8.12 static", for example.

Link: http://s-m-s.tv/PCRE_8.10_Windows_XP


FUNtaste Opera Opera - Internet Explorer - Firefox tested Valid XHTML 1.0 Transitional
Copyright © 2009-2013 FUNtaste Co. All rights reserved.
Chicago, USA
Page created in 0.020205020904541 seconds