[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Library directory missing in pkg-config files
From: |
Michał Liszcz |
Subject: |
Re: Library directory missing in pkg-config files |
Date: |
Wed, 5 Oct 2022 11:42:37 +0200 |
Hi Thomas,
Thanks for your reply.
> Other -L options that it knows about are passed into the ".pc" file.
I'm not passing any custom linker options. I'm just setting the install prefix.
Here is a minimal example that shows the problem on a fresh debian bullseye
system:
docker run -it --rm debian:11
apt update && apt install -y gcc make wget pkg-config
wget -O ncurses.tar.gz
https://invisible-island.net/archives/ncurses/ncurses-6.3.tar.gz
tar xf ncurses.tar.gz
cd ncurses-6.3/
mkdir -p /prefix-ncurses/pkgconfig
env TERMINFO= TERMINFO_DIRS= ./configure --prefix=/prefix-ncurses
--with-termlib --without-shared --enable-pc-files
--with-pkg-config-libdir=/prefix-ncurses/pkgconfig
make -j$(nproc)
make install
cd /tmp
echo -e '#include <ncurses.h>\nint main(void) { initscr(); }' > app.c
export PKG_CONFIG_PATH=/prefix-ncurses/pkgconfig
gcc $(pkg-config --cflags ncurses) app.c $(pkg-config --libs ncurses)
# /usr/bin/ld: cannot find -lncurses
# /usr/bin/ld: cannot find -ltinfo
# collect2: error: ld returned 1 exit status
grep Libs: /prefix-ncurses/pkgconfig/ncurses.pc
# Libs: -lncurses -ltinfo
> I think you left out the essential information:
>
> a) the actual configure options used,
Sorry! I just provided the options in the example above.
> b) the resulting config.status file (which includes (a)).
This is an auto-generated script. Should I post the whole file here?
Perhaps configuration summary will be sufficient?
** Configuration summary for NCURSES 6.3 20211021:
extended funcs: yes
xterm terminfo: xterm-new
bin directory: /prefix-ncurses/bin
lib directory: /prefix-ncurses/lib
include directory: /prefix-ncurses/include/ncurses
man directory: /prefix-ncurses/share/man
terminfo directory: /prefix-ncurses/share/terminfo
pkg-config directory: /prefix-ncurses/pkgconfig
Best regards,
Michal