Lähettäjä: Philip Hazel Päiväys: Vastaanottaja: Bob Rossi Kopio: pcre-dev Aihe: Re: [pcre-dev] 7.6-RC2
On Wed, 23 Jan 2008, Bob Rossi wrote:
> On Wed, Jan 23, 2008 at 06:49:19PM -0500, Sheri wrote:
> > I was sorry to see pcredemo go since Christian had it working for both
> > shared and static, and it built and worked in mingw and in Visual Studio.
> > Maybe you could add a note to the pcresample doc that to build pcredemo (or
> > any app?) on Windows it is imperative to define PCRE_STATIC if the
> > libraries are static libraries. I'm not sure, but I think it is also
> > imperative to link to pcreposix for static even when the posix api is not
> > used (Bob?).
It's already there. From NON-UNIX-USE:
"If you want to statically link your program against a non-dll .a
file, you must define PCRE_STATIC before including pcre.h, otherwise
the pcre_malloc() and pcre_free() exported functions will be declared
__declspec(dllimport), with unwanted results."
I will put an equivalent note into the source of pcredemo.c itself.
> Like anything else, we could get this to work. However, it seems that
> Philip trumped this idea and prefered to just remove it. If that
> situation changes, I will consider thinking about the issue more.
I did not just remove it because it was tricky or hard. I did it on
principle. Users are supposed to compile pcredemo.c (if they want to) as
an example of an application that uses PCRE. It is an example for
programmers who want to write PCRE applications. It is not meant to
demonstrate PCRE's pattern matching - you can use pcretest for that.
Having it built automatically defeats the object.