What steps will reproduce the problem?
1. Try compiling with: `LDFLAGS="-Wl,--as-needed" make'
What is the expected output? What do you see instead?
The expected outcome is a successful compilation. Instead, I get linking
errors like:
./libxdo.so: undefined reference to `XTestFakeRelativeMotionEvent'
./libxdo.so: undefined reference to `XFree'
./libxdo.so: undefined reference to `XTestFakeKeyEvent'
./libxdo.so: undefined reference to `XStringToKeysym'
./libxdo.so: undefined reference to `XConfigureWindow'
./libxdo.so: undefined reference to `XAllocClassHint'
What version of the product are you using? On what operating system?
xdotool 1.20100302.2708 on Arch Linux.
Please provide any additional information below.
Gentoo has some great documentation [1] on the reason the compilation with
--as-needed is failing. The section that applies in this situation is
called "Importance of linking order". It basically says that the libraries
we link to, need to come after the object files that use functions from
them. So, in the libxdo.so rule, we need to put "$(LIBS)" at the end.
----
[1] http://www.gentoo.org/proj/en/qa/asneeded.xml#doc_chap2_sect6
Original issue reported on code.google.com by foutrelis@gmail.com on 2 Mar 2010 at 5:47
Original issue reported on code.google.com by
foutrelis@gmail.com
on 2 Mar 2010 at 5:47