I feel embarrassed to ask this, but I cannot link my small demo program to the xmlrpc-c libs. I know it should be obvious but I am stumped.
I have the same problem if I install the library via apt (Debian) or build/install from source (Debian or macOS).
xmlrpc.c:(.text+0x86): undefined reference to `xmlrpc_client_setup_global_const'
xmlrpc.c:(.text+0xba): undefined reference to `xmlrpc_client_create'
xmlrpc.c:(.text+0xf9): undefined reference to `xmlrpc_client_call2f'
xmlrpc.c:(.text+0x166): undefined reference to `xmlrpc_client_destroy'
xmlrpc.c:(.text+0x16b): undefined reference to `xmlrpc_client_teardown_global_const'
The command I used to compile link was
gcc $(xmlrpc-c-config --libs --cflags client) xmlrpc.c
The output from xmlrpc-c-config
is
-L/usr/lib/x86_64-linux-gnu -lxmlrpc -lxmlrpc_xmlparse -lxmlrpc_xmltok -lxmlrpc_util
-I/usr/include
This all looks good and the libraries are in the expected place.
I have tried the traditional remedy of repeating the library names on the command line e.g.
gcc $(xmlrpc-c-config --cflags client) xmlrpc.c $(xmlrpc-c-config --libs client) $(xmlrpc-c-config --libs client)
but this has had no effect. I have also reviewed the answers in Why does the order in which libraries are linked sometimes cause errors in GCC?, but that does not seem to fix anything.
I have no idea what to try next (I have googled for all I'm worth, but to no avail)