Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > C/C++ программирование > Общие вопросы C/C++
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 13.02.2010, 18:00   #1
Equilibrium Keeper
 
Регистрация: 09.09.2009
Сообщений: 8
По умолчанию Компиляция PCRE 8.01 под Windows

Доброго времени суток.

Понадобилось использовать в программе регулярные выражения. Погуглил, выяснил, что наилучшим вариантом будет использование библиотеки PCRE (http://pcre.org). Проблема в том, что для установки под Windows требуется немного пошаманить с исходниками, о чем развернуто описано в ридмишке NON-UNIX-USE. Проблема в том, что русских документаций именно по компиляции lib-файлов я не нашел, а руководствуясь вышеозначенным доком, ничего толкового добиться не смог - тут и плохое знание английского и очень скудный опыт в программировании.

Библиотека, насколько я понял, очень распространена среди программистов и, наверняка, многие из вас ею пользуются... Большая просьба - объясните: как мне превратить исходные коды с сайта разработчика в две готовые к употреблению lib-библиотеки или выложите уже скомпилированные библиотеки (предпочтительнее - и то и другое, хочется все-таки понять, как это делается (хотя бы для последующих обновлений библиотеки)).

P.S. Альтернативы, вроде boost:regex или компонента TRegEx, просьба не предлагать. Я о них знаю и, если не получится с этой библиотекой, воспользуюсь ими. Тем не менее очень хочется разобраться в PCRE.

Заранее премного благодарен.
Equilibrium Keeper вне форума Ответить с цитированием
Старый 14.02.2010, 22:06   #2
Equilibrium Keeper
 
Регистрация: 09.09.2009
Сообщений: 8
По умолчанию

Вот, собственно, инструкция... Понимаю, что едва ли среди форумчан найдется желающий все это для меня переводить и разжевывать но вдруг... Жирненьким выделены места, которые я вообще не понимаю.

Цитата:
GENERIC INSTRUCTIONS FOR THE PCRE C LIBRARY

The following are generic comments about building the PCRE C library "by hand".

(1) Copy or rename the file config.h.generic as config.h, and edit the macro
settings that it contains to whatever is appropriate for your environment
.
In particular, if you want to force a specific value for newline, you can
define the NEWLINE macro
. When you compile any of the PCRE modules, you
must specify -DHAVE_CONFIG_H to your compiler
so that config.h is included
in the sources.

An alternative approach is not to edit config.h, but to use -D on the
compiler command line
to make any changes that you need to the
configuration options. In this case -DHAVE_CONFIG_H must not be set.

NOTE: There have been occasions when the way in which certain parameters
in config.h are used has changed between releases. (In the configure/make
world
, this is handled automatically.) When upgrading to a new release,
you are strongly advised to review config.h.generic before re-using what
you had previously.

(2) Copy or rename the file pcre.h.generic as pcre.h.

(3) EITHER:
Copy or rename file pcre_chartables.c.dist as pcre_chartables.c.

OR:
Compile dftables.c as a stand-alone program (using -DHAVE_CONFIG_H if
you have set up config.h
), and then run it with the single argument
"pcre_chartables.c". This generates a set of standard character tables
and writes them to that file. The tables are generated using the default
C locale for your system. If you want to use a locale that is specified
by LC_xxx environment variables, add the -L option to the dftables
command.
You must use this method if you are building on a system that
uses EBCDIC code.

The tables in pcre_chartables.c are defaults. The caller of PCRE can
specify alternative tables at run time.

(4) Ensure that you have the following header files:

pcre_internal.h
ucp.h

(5) Also ensure that you have the following file, which is #included as source
when building a debugging version of PCRE, and is also used by pcretest.

pcre_printint.src

(6) Compile the following source files, setting -DHAVE_CONFIG_H as a compiler
option if you have set up config.h with your configuration, or else use
other -D settings to change the configuration as required.


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

Make sure that you include -I. in the compiler command (or equivalent for
an unusual compiler)
so that all included PCRE header files are first
sought in the current directory. Otherwise you run the risk of picking up
a previously-installed file from somewhere else.

(7) Now link all the compiled code into an object library in whichever form
your system keeps such libraries. This is the basic PCRE C library. If
your system has static and shared libraries, you may have to do this once
for each type.

(8) Similarly, if you want to build the POSIX wrapper functions, ensure that
you have the pcreposix.h file and then compile pcreposix.c (remembering
-DHAVE_CONFIG_H if necessary
). Link the result (on its own) as the
pcreposix library.

(9) Compile the test program pcretest.c (again, don't forget -DHAVE_CONFIG_H).
This needs the functions in the PCRE library when linking. It also needs
the pcreposix wrapper functions unless you compile it with -DNOPOSIX
. The
pcretest.c program also needs the pcre_printint.src source file, which it
#includes.
Equilibrium Keeper вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Компиляция под Borland Homer_J_Simpson Общие вопросы C/C++ 7 29.03.2012 17:01
Программирование под Windows на C# I.C.E Помощь студентам 3 29.04.2010 16:39
переделать под windows al072 C/C++ Сетевое программирование 13 16.02.2010 20:57
Программа под Windows girkoff Софт 21 14.02.2010 08:31
Разница исполнения под Windows XP и Windows Server 2003? -Nast- Общие вопросы Delphi 0 02.06.2009 09:20