On 8/22/07, Philip Hazel <ph10@???> wrote:
> On Tue, 21 Aug 2007, Robert Wishlaw wrote:
>
> > I had not added the define PCRE_STATIC to my build because I was not
> > building a STATIC library, I was building a DLL, so I assumed,
> > incorrectly, that the STATIC in PCRE_STATIC referred to a STATIC
> library.
> >
> > When looking at the declspec defines I thought Richard Daniel had got it
> > backwards until I realized that the PRCE_STATIC define had to be used
> when
> > building a DLL but not when building a STATIC library.
>
> I can't claim to understand much about Windows (a system I have never
> used), but the comment in config.h says
>
> /* Define if linking statically (TODO: make nice with Libtool) */
> /* #undef PCRE_STATIC */
>
> ... which disagrees with your conclusion.
Well you know what that means ... I was presumptuous. As it turned out, I
managed to compile the DLLs without error but they did not work correctly. I
experienced problems similar to those described by Sheri.
> (Incidentally, which PCRE release?)
pcre-7.3-RC8
As an exercise in understanding PCRE, I am going to redo the Win32 declspecs
based on something like this
#if defined (_WIN32)
# if defined DLL
# define DECLSPEC __declspec(dllexport)
# else
# define DECLSPEC __declspec(dllimport)
# endif
#endif
which is modified from an example on a Microsoft website
Portable DLL Example Using _declspec() and _export
at
http://support.microsoft.com/kb/123870
I am omitting the facility for defining the calling convention, that
is, CDECL or STDCALL or PASCAL or FASTCALL which, in the Microsoft example,
is the EXPORT define.
If I can get it to work correctly, I will let you know. It is not too
different from what was in PCRE prior to version 7.1.
Robert Wishlaw
Philip
--
Philip Hazel, University of Cambridge Computing Service.