aria2 icon indicating copy to clipboard operation
aria2 copied to clipboard

/usr/bin/ld: cannot find -lp11-kit

Open slyfox1186 opened this issue 2 years ago • 1 comments

I have tried to build this on 3 differnt OS.

Ubuntu Bionic Focal Jammy

All 3 give this warning: /usr/bin/ld: cannot find -lp11-kit

However, it seems to find it due to what the configure script shows right before MAKE begins.

I say this because of this line showing: -lp11-kit

And here is the last code in MAKE before it prints failure.

In file included from /usr/include/c++/12/string:48,
                 from UDPTrackerClient.h:40:
/usr/include/c++/12/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
/usr/bin/ld: cannot find -lp11-kit: No such file or directory
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:2157: aria2c] Error 1
make[2]: *** [Makefile:2679: all-recursive] Error 1
make[1]: *** [Makefile:557: all-recursive] Error 1
make: *** [Makefile:468: all] Error 2

Failed to Execute make -j32
    version:        1.1.1 shared 1:1:1
    Host type:      x86_64-pc-linux-gnu
    Install prefix: /usr/local
    C compiler:     gcc
    CFlags:         -g -O2
    Library types:  Shared=no, Static=yes
    CUnit:          yes
    Nettle:         yes
    Build examples: yes

configure: summary of build options:

Build:          x86_64-pc-linux-gnu
Host:           x86_64-pc-linux-gnu
Target:         x86_64-pc-linux-gnu
Install prefix: /usr/local
CC:             gcc
CXX:            g++
CPP:            gcc -E
CXXFLAGS:       -g -O3 -march=native -mtune=native
CFLAGS:         -g -O2
CPPFLAGS:       -I/home/jman/tmp/curl-build-script/workspace/include -I/usr/local/include -I/usr/include -I/usr/include/p11-kit-1
LDFLAGS:        -L/usr/local/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu64 -L/usr/local/lib64 -L/lib64 -L/usr/lib64 -L/usr/local/lib -L/lib -L/usr/lib -L/usr/lib/p11-kit-1 -L/usr/x86_64-linux-gnu/lib64 -L/usr/x86_64-linux-gnu/lib
LIBS:
DEFS:           -DHAVE_CONFIG_H
CXX1XCXXFLAGS:
EXTRACXXFLAGS:   -pipe
EXTRACFLAGS:     -pipe
EXTRACPPFLAGS:
EXTRALDFLAGS:    -all-static
EXTRALIBS:       -lpthread -ldl -lrt
WARNCXXFLAGS:
LibUV:          no (CFLAGS='' LIBS='')
SQLite3:        no (CFLAGS='' LIBS='')
SSL Support:    yes
AppleTLS:       no (LDFLAGS='')
WinTLS:         no (LIBS='')
GnuTLS:         yes (CFLAGS='-I/home/jman/tmp/curl-build-script/workspace/include -I/usr/include/p11-kit-1' LIBS='-L/home/jman/tmp/curl-build-script/workspace/lib -lgnutls -lgmp /usr/lib/x86_64-linux-gnu/libunistring.so -lidn2 -lhogweed -lgmp -lnettle -ltasn1 -lp11-kit -lz')
OpenSSL:        no (CFLAGS='' LIBS='')
CA Bundle:      /etc/ssl/certs/cacert-2023-05-30.pem
LibNettle:      yes (CFLAGS='' LIBS='-lnettle')
LibGmp:         yes (CFLAGS='' LIBS='-lgmp')
LibGcrypt:      no (CFLAGS='' LIBS='')
LibXML2:        yes (CFLAGS='-I/usr/include/libxml2' LIBS='-lxml2 -licui18n -licuuc -licudata -lz -llzma -lm')
LibExpat:       no (CFLAGS='' LIBS='')
LibCares:       yes (CFLAGS='' LIBS='-lcares')
Zlib:           yes (CFLAGS='-I/home/jman/tmp/curl-build-script/workspace/include' LIBS='-L/home/jman/tmp/curl-build-script/workspace/lib -lz')
Libssh2:        yes (CFLAGS='-I/home/jman/tmp/curl-build-script/workspace/include' LIBS='-L/home/jman/tmp/curl-build-script/workspace/lib -lssh2 -lgcrypt -lgpg-error -lz')
Tcmalloc:       yes (CFLAGS='' LIBS='-ltcmalloc_minimal -pthread -lpthread')
Jemalloc:       no (CFLAGS='' LIBS='')
Epoll:          yes
Bittorrent:     yes
Metalink:       yes
XML-RPC:        yes
Message Digest: libnettle
WebSocket:      yes (CFLAGS='-I$(top_builddir)/deps/wslay/lib/includes -I$(top_srcdir)/deps/wslay/lib/includes' LIBS='$(top_builddir)/deps/wslay/lib/libwslay.la')
Libaria2:       yes (shared=no static=yes)
bash_completion dir: ${datarootdir}/doc/${PACKAGE_TARNAME}/bash_completion
Static build:   yes

$ make -j32
libtool: warning: '-version-info/-version-number' is ignored for convenience libraries
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
/usr/bin/ld: cannot find -lp11-kit
collect2: error: ld returned 1 exit status
make[3]: *** [aria2c] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Here is my command line

    ./configure \
        --prefix='/usr/local' \
        --enable-static \
        --disable-shared \
        --enable-libaria2 \
        --with-tcmalloc \
        --with-ca-bundle='/etc/ssl/certs/cacert-2023-05-30.pem' \
        ARIA2_STATIC=yes \
        CXXFLAGS='-g -O3 -march=native -mtune=native' \
        CPPFLAGS="-I$workspace/include -I/usr/local/include -I/usr/include -I/usr/include/p11-kit-1" \
        LDFLAGS="-L/usr/local/lib/x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu64 -L/usr/local/lib64 -L/lib64 -L/usr/lib64 -L/usr/local/lib -L/lib -L/usr/lib -L/usr/lib/p11-kit-1 -L/usr/x86_64-linux-gnu/lib64 -L/usr/x86_64-linux-gnu/lib" \
        PKG_CONFIG='/usr/bin/pkg-config'

Any ideas?

slyfox1186 avatar Jun 05 '23 21:06 slyfox1186

Try to compile aria2 with ./configure ARIA2_STATIC=yes --without-gnutls --with-openssl, Use openssl not gnutls.

kasie-zhang avatar Sep 07 '23 08:09 kasie-zhang