Re: Pcre static library

Kees Zeelenberg <[email protected]>
Newsgroups gmane.comp.windows.gnu.user
Message-ID <005d01c7bf58$ffdd29e0$34106550@gamma>
----- Original Message ----- 
From: "tuitfun" <[email protected]>
To: "gnuwin32" <[email protected]>
Sent: Wednesday, July 04, 2007 4:54 PM
Subject: [GnuWin32-Users] Pcre static library

> Pcre package only has libpcre.dll.a (no libpcre.a). can i build a program 
> that
> links statically to Pcre? i tried to compile pcredemo.c and it ran fine 
> with
> dynamic linking. however, when i tried to compile statically with:

You cannot create a static version of your program by using libpcre.dll.a. 
This library contains only references to the DLL and does not carry any 
compiled code.

For myself, I cannot see why using the DLL should be avoided. MS-Windows 
overflows with DLL's, your program very probably links to many of these 
(msvcrt.dll, kernel32.dll, user32.dll, ntdll.dll, ...), so why shouldn't 
your project use another one?
If you still want a static library, you can follow the steps at 
http://gnuwin32.sourceforge.net/compile.html, and use the 
"--enable-static --disable-shared" option to configure. You could also tweak 
the the sources from Gnuwin32 (in particular replacing any occurrence 
of -DBUILD_PCRE_DLL or -DBUILD_PCRECPP_DLL
by -DSTATIC -D__STATIC__  -DPCRE_STATIC), but on the way to a usable static 
library, you would probably encounter several problems (which shouldn't be 
hard to solve if you have a reasonable amount of experience in Make, 
Autoconf and Automake).

Kees Zeelenberg 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.