Undefined reference error with methods of libxmlrpc-c3-dev
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
opennebula (Debian) |
Fix Released
|
Undecided
|
Unassigned | ||
opennebula (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
xmlrpc-c (Debian) |
Fix Released
|
Unknown
|
|||
xmlrpc-c (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: gcc-4.5
I'm in a natty environment (created with pbuilder in an Ubuntu maverick).
# pbuilder create --distribution natty --othermirror "deb
http://
multiverse"
# pbuilder --login
Check g++ version:
# g++ --version|head -1
g++ (Ubuntu/Linaro 4.5.1-12ubuntu1) 4.5.2
I install required dependencies:
# apt-get install libxmlrpc-c3-dev libcurl4-
I create a small program which uses the xmlrpc-c library:
-------
server.cpp
-------
#include <xmlrpc-c/base.hpp>
#include <xmlrpc-
int main(int argc, char *argv[])
{
xmlrpc_
return 0;
}
-------
I obtain the building libraries with xmlrpc-config:
# xmlrpc-c-config c++2 abyss-server --libs --cflags
-L/usr/lib -lxmlrpc_
-lxmlrpc_
-lxmlrpc++ -lxmlrpc -lxmlrpc_util -lxmlrpc_xmlparse -lxmlrpc_xmltok
-I/usr/include
I compile the program:
# g++ server.cpp `xmlrpc-c-config c++2 abyss-server --libs --cflags`
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
collect2: ld returned 1 exit status
If we look for the missing references manually we can find them:
# nm -D /usr/lib/
000000000000db80 T _ZN8xmlrpc_
U xmlrpc_traceXml
This used to work with previous versions of gcc:
(in the same environment)
# apt-get install g++-4.4
Check g++ version:
# g++-4.4 --version|head -1
g++-4.4 (Ubuntu/Linaro 4.4.5-10ubuntu1) 4.4.5
# g++-4.4 server.cpp `xmlrpc-c-config c++2 abyss-server --libs --cflags`
# echo $?
0
We need to fix this in order to complete the following merge:
https:/
Thank you
Changed in xmlrpc-c (Debian): | |
status: | Unknown → New |
Changed in xmlrpc-c (Debian): | |
status: | New → Fix Committed |
Changed in xmlrpc-c (Debian): | |
status: | Fix Committed → Fix Released |
This is not a GCC bug, it's a result of the no-add-needed linker changes.
The following works for me:
$ g++ -o server server.cpp -lxmlrpc_server++ -lxmlrpc++ -lxmlrpc -lxmlrpc_xmlparse -lxmlrpc_xmltok -lxmlrpc_server
or, as a workaround:
$ g++ -o server server.cpp -Wl,--no-as-needed `xmlrpc-c-config c++2 abyss-server --libs`