C
C
couatl2011-12-01 22:20:29
ubuntu
couatl, 2011-12-01 22:20:29

PCRE in C++ and Ubuntu 11.10?

I needed to use regular expressions in a C++ project. I took the PCRE library.
I took an elementary example from Wikipedia (what can I say, this example is everywhere, although the strlen function is used in this, and therefore you need to add #include <string.h>) I
compile
g++ -Wall -lpcre main.cpp -o main.o
I see a fig
In function `main':
main.cpp:(.text+0x62): undefined reference to `pcre_maketables'
main.cpp:(.text+0xac): undefined reference to `pcre_compile'
main.cpp:(.text+0x136): undefined reference to `pcre_exec'
collect2: ld exited with return code 1
As if -lpcre didn't work.
On 10.10 and 11.04 everything is ok.
The question is what did they break in 11.10 and how to solve it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mitry, 2011-12-01
@mitry

-lpcreshould be at the end of the line, like all libraries

@
@ngreduce, 2011-12-01
_

libpcre.a is where it should be?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question