strophe / libstrophe

A simple, lightweight C library for writing XMPP clients
http://strophe.im/libstrophe
Other
401 stars 163 forks source link

Tests fail without static libraries #175

Closed ghost closed 3 years ago

ghost commented 3 years ago

When building libstrophe (v0.10.1) from source, with --disable-static configure-flag, the build fails with following errors:

test_hash.c:(.text+0x7e): undefined reference to `hash_new'
ld: test_hash.c:(.text+0xe2): undefined reference to `hash_add'
ld: test_hash.c:(.text+0x10d): undefined reference to `hash_num_keys'
ld: test_hash.c:(.text+0x168): undefined reference to `hash_add'
ld: test_hash.c:(.text+0x185): undefined reference to `hash_num_keys'
ld: test_hash.c:(.text+0x1b1): undefined reference to `hash_get'
ld: test_hash.c:(.text+0x23b): undefined reference to `hash_add'
ld: test_hash.c:(.text+0x247): undefined reference to `hash_clone'
ld: test_hash.c:(.text+0x274): undefined reference to `hash_get'
ld: test_hash.c:(.text+0x2d1): undefined reference to `hash_iter_new'
ld: test_hash.c:(.text+0x2fb): undefined reference to `hash_iter_next'
ld: test_hash.c:(.text+0x331): undefined reference to `hash_iter_next'
ld: test_hash.c:(.text+0x352): undefined reference to `hash_iter_next'
ld: test_hash.c:(.text+0x373): undefined reference to `hash_iter_release'
ld: test_hash.c:(.text+0x37f): undefined reference to `hash_release'
ld: test_hash.c:(.text+0x399): undefined reference to `hash_drop'
ld: test_hash.c:(.text+0x3b3): undefined reference to `hash_get'
ld: test_hash.c:(.text+0x3dc): undefined reference to `hash_drop'
ld: test_hash.c:(.text+0x3f6): undefined reference to `hash_drop'
ld: test_hash.c:(.text+0x410): undefined reference to `hash_get'
ld: test_hash.c:(.text+0x439): undefined reference to `hash_get'
ld: test_hash.c:(.text+0x45e): undefined reference to `hash_get'
ld: test_hash.c:(.text+0x484): undefined reference to `hash_get'
ld: test_hash.c:(.text+0x49c): undefined reference to `hash_release'
collect2: error: ld returned 1 exit status
jubalh commented 3 years ago

Also reported here: https://github.com/profanity-im/libmesode/issues/20 Discussed in Profanity MUC to post here.

ghost commented 3 years ago

@pasis Any ideas?

pasis commented 3 years ago

This is expected, tests rely on static library, because shared library exports only symbols starting from xmpp_.

ghost commented 3 years ago

@pasis @jubalh

Changing '^xmpp_' to '.', in Makefile.am, fixed the errors for me. Thanks to @nckx

:-)