1

I'm trying to compile libpcap and libssl statically (with -static) and linker get me these errors:

more undefined references to `ASN1_const_check_infinite_end' follow myprogram       line 0, external location: /lib64/libssl.a(ssl_asn1.o)  
more undefined references to `BIO_test_flags' follow    myprogram   line 0, external location: /lib64/libssl.a(ssl_lib.o)   
------------------------truncated for brevity----------------------------------

I'm using ubuntu 11.4 i686_64 and a nm result on libssl.a with greping BIO_test_flags, is: U BIO_test_flags that means this symbol is an undefined one and all of undefined symbols are in the same status.

How can I solve this linking problem? (any idea or approaches are welcome) [note that static compilation is a must for me]

scvalex
  • 14,931
  • 2
  • 34
  • 43

1 Answers1

1

Presumably one of the static libraries is missing. Maybe you can tell which just by looking, but if not, here's a few ways to figure it out:

Add -t to your link command and see if that helps.

Try to strace the link command (beware that gcc invokes the linker as a subprocess, so you'll need to follow forks) and see what library files it's not finding, and where it's looking for them.

ams
  • 24,923
  • 4
  • 54
  • 75