hostapd-0.6.8 build with OpenSSL-0.9.8i fails with 'undefined reference to `dlsym'', etc.

Pavel Roskin proski
Mon Mar 9 13:57:05 PDT 2009


On Mon, 2009-03-09 at 10:28 -0500, Michael Everett wrote:
> Building hostapd-0.6.8 after installing OpenSSL-0.9.8i (or 0.9.8j)
> fails with undefined references related to OpenSSL dso_dlfcn.c in
> libcrypto.a  as follows:
>  
> ------------------------------------------------
>  
> cc -o hostapd hostapd.o ieee802_1x.o eapol_sm.o ieee802_11.o config.o
> ieee802_11_auth.o accounting.o sta_info.o wpa.o ctrl_iface.o drivers.o
> preauth.o pmksa_cache.o beacon.o hw_features.o wme.o ap_list.o mlme.o
> vlan_init.o
> wpa_auth_ie.o ../src/utils/eloop.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/wpabuf.o ../src/utils/os_unix.o ../src/utils/ip_addr.o ../src/common/ieee802_11_common.o ../src/common/wpa_common.o ../src/radius/radius.o ../src/radius/radius_client.o ../src/crypto/md5.o ../src/crypto/rc4.o ../src/crypto/md4.o ../src/crypto/sha1.o ../src/crypto/des.o ../src/crypto/aes_wrap.o ../src/crypto/aes.o iapp.o peerkey.o driver_madwifi.o ../src/l2_packet/l2_packet_linux.o ../src/eap_server/eap_md5.o ../src/eap_server/eap_tls.o ../src/eap_server/eap_peap.o ../src/eap_common/eap_peap_common.o ../src/eap_server/eap_ttls.o ../src/eap_server/eap_mschapv2.o ../src/eap_server/eap_gtc.o ../src/eap_server/eap.o ../src/eap_common/eap_common.o ../src/eap_server/eap_methods.o ../src/eap_server/eap_identity.o ../src/eap_server/eap_tls_common.o ../src/crypto/tls_openssl.o ../src/crypto/ms_funcs.o ../src/eap_common/chap.o ../src/crypto/crypto_openssl.o -L/usr/src/openssl -L/usr/local/ssl/lib -L/usr/lib -lssl -lcrypto
> /usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function
> `dlfcn_bind_func':
> dso_dlfcn.c:(.text+0x2d4): undefined reference to `dlsym'

It looks like adding "-ldl" to the command line should fix it.  Shared
libraries can indicate their dependencies automatically, but static
libraries (such as libcrypto.a) cannot.  I suggest that you compile
OpenSSL as a shared library, as it will avoid such pitfalls.

-- 
Regards,
Pavel Roskin



More information about the Hostap mailing list