Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 23.04 build fails with undefined reference to pcre_config #18

Closed
cirosantilli opened this issue Oct 10, 2023 · 0 comments · Fixed by #19
Closed

Ubuntu 23.04 build fails with undefined reference to pcre_config #18

cirosantilli opened this issue Oct 10, 2023 · 0 comments · Fixed by #19

Comments

@cirosantilli
Copy link
Contributor

cirosantilli commented Oct 10, 2023

At efd3ef1 cd and make gives:

cc -o bin/csvcut  -std=gnu99 -Wall -pedantic -Wextra -DBUFFER_SIZE=1048576  -fno-strict-aliasing -O3 -DNDEBUG -D_GNU_SOURCE src/csvcut.c src/csv_tokenizer.c 
cc -o bin/csvgrep  `pcre-config --libs` -std=gnu99 -Wall -pedantic -Wextra -DBUFFER_SIZE=1048576  -fno-strict-aliasing -O3 -DNDEBUG -D_GNU_SOURCE `pcre-config --cflags` src/csvgrep.c src/csv_tokenizer.c 
/usr/bin/ld: /tmp/ccjk4lIW.o: warning: relocation against `pcre_free' in read-only section `.text.startup'
/usr/bin/ld: /tmp/ccjk4lIW.o: in function `output_cells':
csvgrep.c:(.text+0x2dd): undefined reference to `pcre_exec'
/usr/bin/ld: /tmp/ccjk4lIW.o: in function `main':
csvgrep.c:(.text.startup+0x23c): undefined reference to `pcre_config'
/usr/bin/ld: csvgrep.c:(.text.startup+0x53a): undefined reference to `pcre_compile'
/usr/bin/ld: csvgrep.c:(.text.startup+0x588): undefined reference to `pcre_study'
/usr/bin/ld: csvgrep.c:(.text.startup+0x8b6): undefined reference to `pcre_free_study'
/usr/bin/ld: csvgrep.c:(.text.startup+0x8cb): undefined reference to `pcre_free'
/usr/bin/ld: csvgrep.c:(.text.startup+0x91d): undefined reference to `pcre_free'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make: *** [Makefile:75: bin/csvgrep] Error 1

Installed packages:

ii  libpcre16-3:amd64                              2:8.39-15                               amd64        Old Perl 5 Compatible Regular Expression Library - 16 bit runtime files
ii  libpcre2-16-0:amd64                            10.42-1                                 amd64        New Perl Compatible Regular Expression Library - 16 bit runtime files
ii  libpcre2-32-0:amd64                            10.42-1                                 amd64        New Perl Compatible Regular Expression Library - 32 bit runtime files
ii  libpcre2-8-0:amd64                             10.42-1                                 amd64        New Perl Compatible Regular Expression Library- 8 bit runtime files
ii  libpcre2-8-0:i386                              10.42-1                                 i386         New Perl Compatible Regular Expression Library- 8 bit runtime files
ii  libpcre2-dev:amd64                             10.42-1                                 amd64        New Perl Compatible Regular Expression Library - development files
ii  libpcre2-posix3:amd64                          10.42-1                                 amd64        New Perl Compatible Regular Expression Library - posix-compatible runtime files
ii  libpcre3:amd64                                 2:8.39-15                               amd64        Old Perl 5 Compatible Regular Expression Library - runtime files
ii  libpcre3-dev:amd64                             2:8.39-15                               amd64        Old Perl 5 Compatible Regular Expression Library - development files
ii  libpcre32-3:amd64                              2:8.39-15                               amd64        Old Perl 5 Compatible Regular Expression Library - 32 bit runtime files
ii  libpcrecpp0v5:amd64                            2:8.39-15                               amd64        Old Perl 5 Compatible Regular Expression Library - C++ runtime files
ii  pcregrep                                       2:8.39-15                               amd64        grep utility that uses perl 5 compatible regexes.
cirosantilli added a commit to cirosantilli/csvtools that referenced this issue Oct 10, 2023
Fix DavyLandman#18

Before this commit build fails with:

```
cc -o bin/csvcut  -std=gnu99 -Wall -pedantic -Wextra -DBUFFER_SIZE=1048576
-fno-strict-aliasing -O3 -DNDEBUG -D_GNU_SOURCE src/csvcut.c
src/csv_tokenizer.c
cc -o bin/csvgrep  `pcre-config --libs` -std=gnu99 -Wall -pedantic -Wextra
-DBUFFER_SIZE=1048576  -fno-strict-aliasing -O3 -DNDEBUG -D_GNU_SOURCE
`pcre-config --cflags` src/csvgrep.c src/csv_tokenizer.c
/usr/bin/ld: /tmp/ccjk4lIW.o: warning: relocation against `pcre_free' in
read-only section `.text.startup'
/usr/bin/ld: /tmp/ccjk4lIW.o: in function `output_cells':
csvgrep.c:(.text+0x2dd): undefined reference to `pcre_exec'
/usr/bin/ld: /tmp/ccjk4lIW.o: in function `main':
csvgrep.c:(.text.startup+0x23c): undefined reference to `pcre_config'
/usr/bin/ld: csvgrep.c:(.text.startup+0x53a): undefined reference to
`pcre_compile'
/usr/bin/ld: csvgrep.c:(.text.startup+0x588): undefined reference to
`pcre_study'
/usr/bin/ld: csvgrep.c:(.text.startup+0x8b6): undefined reference to
`pcre_free_study'
/usr/bin/ld: csvgrep.c:(.text.startup+0x8cb): undefined reference to
`pcre_free'
/usr/bin/ld: csvgrep.c:(.text.startup+0x91d): undefined reference to
`pcre_free'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make: *** [Makefile:75: bin/csvgrep] Error 1
```
DavyLandman pushed a commit that referenced this issue Oct 10, 2023
Fix #18

Before this commit build fails with:

```
cc -o bin/csvcut  -std=gnu99 -Wall -pedantic -Wextra -DBUFFER_SIZE=1048576
-fno-strict-aliasing -O3 -DNDEBUG -D_GNU_SOURCE src/csvcut.c
src/csv_tokenizer.c
cc -o bin/csvgrep  `pcre-config --libs` -std=gnu99 -Wall -pedantic -Wextra
-DBUFFER_SIZE=1048576  -fno-strict-aliasing -O3 -DNDEBUG -D_GNU_SOURCE
`pcre-config --cflags` src/csvgrep.c src/csv_tokenizer.c
/usr/bin/ld: /tmp/ccjk4lIW.o: warning: relocation against `pcre_free' in
read-only section `.text.startup'
/usr/bin/ld: /tmp/ccjk4lIW.o: in function `output_cells':
csvgrep.c:(.text+0x2dd): undefined reference to `pcre_exec'
/usr/bin/ld: /tmp/ccjk4lIW.o: in function `main':
csvgrep.c:(.text.startup+0x23c): undefined reference to `pcre_config'
/usr/bin/ld: csvgrep.c:(.text.startup+0x53a): undefined reference to
`pcre_compile'
/usr/bin/ld: csvgrep.c:(.text.startup+0x588): undefined reference to
`pcre_study'
/usr/bin/ld: csvgrep.c:(.text.startup+0x8b6): undefined reference to
`pcre_free_study'
/usr/bin/ld: csvgrep.c:(.text.startup+0x8cb): undefined reference to
`pcre_free'
/usr/bin/ld: csvgrep.c:(.text.startup+0x91d): undefined reference to
`pcre_free'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make: *** [Makefile:75: bin/csvgrep] Error 1
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant