[pcre-dev] PCRE demonstration program

Pàgina inicial
Delete this message
Autor: Rafael Fernández López
Data:  
A: pcre-dev
Assumpte: [pcre-dev] PCRE demonstration program
Hi there,

Have seen the pcredemo.c on the distribution, and I think the
instructions to compile under Unix-like environments can be improved.
Here it is:

---
In Unix-like environments, compile this program thuswise:

  gcc -Wall pcredemo.c -I/usr/local/include -L/usr/local/lib \
    -R/usr/local/lib -lpcre


Replace "/usr/local/include" and "/usr/local/lib" with wherever the include and
library files for PCRE are installed on your system. You don't need -I and -L
if PCRE is installed in the standard system libraries. Only some operating
systems (e.g. Solaris) use the -R option.
---

It is far easier (and less confusing) to use pkg-config:

---
gcc -Wall pcredemo.c `pkg-config --cflags --libs libpcre` -o pcredemo
---


Best regards,
Rafael Fernández López.