Author: Graycode Date: To: pcre-dev Subject: Re: [pcre-dev] Calculated match recursion stack size
On Sat, 21 Jan 2012, Philip Hazel wrote:
> But wait: pcretest.c includes the line
>
> #include "pcre_tables.c"
>
> so why do you need it externally as well? It must be a bit more
> complicated...
Oh I didn't see that at all. The key must be that the link errors
originate from the object of pcre_printint vs. pcretest.
pcre_printint.obj : error LNK2001: unresolved external symbol __pcre_OP_lengths
pcre_printint.obj : error LNK2001: unresolved external symbol __pcre_utf8_table3
pcre_printint.obj : error LNK2001: unresolved external symbol __pcre_utf8_table4
So in _printint a reference to PRIV(utf8_table3) expands into being
'_pcre_utf8_table3' or '_pcre16_utf8_table3', which is a different
name than in pcretest.c. That's why an additional compilation of
pcre_tables is needed in order for the linker to resolve the
same-named variables when pcre_printint.c is compiled independently.
Prior versions had a #include of pcre_printint.SRC in pcretest.c,
maybe this was the reason ??