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
In Gentoo, the libcurl.pc file generated for pkg-config has the following line:
$ grep Libs.private /usr/lib64/pkgconfig/libcurl.pc Libs.private: -llber -lldap
so a call to pkgconfig for static linking returns those libraries in that order:
$ pkg-config --static --libs libcurl -lcurl -llber -lldap -lz -lssl -ldl -lz -lcrypto -ldl -lz
but ldap depends on lber so linking fails:
$ gcc -o test test.c -static pkg-config --libs --static libcurl [lots of warnings] result.c:(.text+0xa19): undefined reference to ber_get_int' result.c:(.text+0xa80): undefined reference to ber_scanf' result.c:(.text+0xa98): undefined reference to ber_peek_tag' result.c:(.text+0xbcd): undefined reference to ber_scanf' result.c:(.text+0xc58): undefined reference to ber_peek_tag' result.c:(.text+0xd86): undefined reference to ber_peek_tag' result.c:(.text+0xe09): undefined reference to ber_scanf' result.c:(.text+0xe19): undefined reference to ber_peek_tag' result.c:(.text+0x10c6): undefined reference to ber_scanf' result.c:(.text+0x1579): undefined reference to ber_scanf' result.c:(.text+0x15e1): undefined reference to ber_peek_tag' result.c:(.text+0x1625): undefined reference to ber_peek_tag' result.c:(.text+0x18a4): undefined reference to ber_scanf' result.c:(.text+0x1b13): undefined reference to ber_peek_tag' result.c:(.text+0x1b94): undefined reference to ber_peek_tag' result.c:(.text+0x1cc5): undefined reference to ber_printf' result.c:(.text+0x1ce9): undefined reference to ber_skip_tag' result.c:(.text+0x1cff): undefined reference to ber_get_enum' result.c:(.text+0x1d15): undefined reference to `ber_peek_tag'
pkg-config --libs --static libcurl
ber_get_int' result.c:(.text+0xa80): undefined reference to
ber_peek_tag' result.c:(.text+0xbcd): undefined reference to
ber_peek_tag' result.c:(.text+0xd86): undefined reference to
ber_scanf' result.c:(.text+0xe19): undefined reference to
ber_scanf' result.c:(.text+0x1579): undefined reference to
ber_peek_tag' result.c:(.text+0x1625): undefined reference to
ber_scanf' result.c:(.text+0x1b13): undefined reference to
ber_peek_tag' result.c:(.text+0x1cc5): undefined reference to
ber_skip_tag' result.c:(.text+0x1cff): undefined reference to
Compilation works if I manually swap the positions of lber and ldap in the command line.
The text was updated successfully, but these errors were encountered:
configure: try ldap/lber in reversed order first
3f430ec
When scanning for which LDAP libraries to use, try the -lldap -llber combination before the reversed order since it has a greater chance of working when linking with libcurl statically. Fixes #1619 Reported-by: David E. Narváez
c534384
No branches or pull requests
In Gentoo, the libcurl.pc file generated for pkg-config has the following line:
$ grep Libs.private /usr/lib64/pkgconfig/libcurl.pc
Libs.private: -llber -lldap
so a call to pkgconfig for static linking returns those libraries in that order:
$ pkg-config --static --libs libcurl
-lcurl -llber -lldap -lz -lssl -ldl -lz -lcrypto -ldl -lz
but ldap depends on lber so linking fails:
$ gcc -o test test.c -static
pkg-config --libs --static libcurl
[lots of warnings]
result.c:(.text+0xa19): undefined reference to
ber_get_int' result.c:(.text+0xa80): undefined reference to
ber_scanf'result.c:(.text+0xa98): undefined reference to
ber_peek_tag' result.c:(.text+0xbcd): undefined reference to
ber_scanf'result.c:(.text+0xc58): undefined reference to
ber_peek_tag' result.c:(.text+0xd86): undefined reference to
ber_peek_tag'result.c:(.text+0xe09): undefined reference to
ber_scanf' result.c:(.text+0xe19): undefined reference to
ber_peek_tag'result.c:(.text+0x10c6): undefined reference to
ber_scanf' result.c:(.text+0x1579): undefined reference to
ber_scanf'result.c:(.text+0x15e1): undefined reference to
ber_peek_tag' result.c:(.text+0x1625): undefined reference to
ber_peek_tag'result.c:(.text+0x18a4): undefined reference to
ber_scanf' result.c:(.text+0x1b13): undefined reference to
ber_peek_tag'result.c:(.text+0x1b94): undefined reference to
ber_peek_tag' result.c:(.text+0x1cc5): undefined reference to
ber_printf'result.c:(.text+0x1ce9): undefined reference to
ber_skip_tag' result.c:(.text+0x1cff): undefined reference to
ber_get_enum'result.c:(.text+0x1d15): undefined reference to `ber_peek_tag'
Compilation works if I manually swap the positions of lber and ldap in the command line.
The text was updated successfully, but these errors were encountered: