You are not logged in.
Pages: 1
/usr/bin/ld: main.o: undefined reference to symbol 'XPending'
/usr/bin/ld: note: 'XPending' is defined in DSO /usr/lib/libX11.so.6 so try adding it to the linker command line
/usr/lib/libX11.so.6: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [netwmpager] error 1
Last edited by nevliv (2012-05-30 01:56:33)
Would like to make friends beyond China area!
Offline
The error tells you exactly what is wrong and what should be done to fix it. Add -lX11 to the linker line.
If you want more help than that we'd need to know what package you were trying to compile.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Assuming you're trying to compile netwmpager, you simply need to add a line "LDFLAGS = -lX11" to the package's Makefile.
Offline
Ah, I guess the package name was hidden in there. Edit the pkgbuild to add the sed line in build()
build() {
cd $startdir/src/$pkgname-$pkgver
./configure --prefix=/usr
sed -i 's/\(call cmd,ld,.*\)$/\1 -lX11/' Makefile
make || return 1
make DESTDIR=$startdir/pkg install
}
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
My goodness, that's brilliant.
Offline
I'm not sure if that was sarcasm, I'll assume not. If not, sadly it's not really brilliant, just necessary. It seems there are a lot of "broken" PKGBUILDs floating around*. Sed patches are required for many packages. It's become particularly prevelant for sources that include glib/*.h which has to be replaced with glib.h as of a recent revision to glib.
Note: not really complaining as I'm not volunteering to take over for all the AUR package maintainers. But AUR users should have a working knowledge of how to "fix" the PKGBUILDs that fail.
Last edited by Trilby (2012-05-28 18:05:30)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Sorry if I sounded sarcastic; I'm serious. I've seen several AUR packages that require changing the Makefile, and that method's going to come in handy in the future. I'm pretty new to the whole Arch thing, and my first thought after reading your post was quite literally, "my goodness, that's brilliant."
Last edited by bananagranola (2012-05-28 23:17:52)
Offline
Thanks, Trilby, you are great, it works and solved my problem.
Would like to make friends beyond China area!
Offline
the same promble when i try to compile extcalc occured.
/usr/bin/ld: CMakeFiles/extcalc.dir/src/graphout.o: undefined reference to symbol 'glEnd'
/usr/bin/ld: note: 'glEnd' is defined in DSO /usr/lib/libGL.so.1 so try adding it to the linker command line
/usr/lib/libGL.so.1: could not read symbols: Invalid operation
collect2: error:ld return1
make[2]: *** [extcalc] error 1
try to add that "sed" line ,replace lX11 with glEnd, but not work, sorry, i am new baby.:-)
Would like to make friends beyond China area!
Offline
I guess you should replace -lX11 by -lGL but I'm also new .
Offline
Yup, not quite the same problem. It's an entirely independent problem with a related root cause: old/faulty PKGBUILDS.
Terminator is correct about the general solution, but note the sed line will have to be modified more than that. The above sed line was specific to the netwmpager Makefile. The extcalc Makefile will not have the same linker line so the sed context will not match.
For one-of fixes, it's probably easier to manually edit the Makefile. Once you find an edit that works, it can be made into a sed line [and reported to the package maintainer] so they can add it to the PKGBUILD in the AUR, so other users can benefit from your fix.
Just to stress that last point - please make sure you are reporting these problems and the fixes on the AUR page of the package.
EDIT: I just looked at extcalc. It uses cmake. I'm not remotely familiar with cmake, so the exact solution for this package may be very different.
Last edited by Trilby (2012-05-29 13:02:02)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Ok, i just add a line <export LDFLAGS="-lGL">
it works,ahh, U guys are so kind.
Would like to make friends beyond China area!
Offline
*Slaps forehead*
Now THAT is brilliant ... AND it is the 'right' way to do it.
Last edited by Trilby (2012-05-30 01:58:25)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Trying to build extcalc with the changes above, but still getting the error.
Just c/p the suggested lines:
http://pastebin.com/MpB0TLGX
Sorry don't exactly know what I'm doing not quite into writing pkgfiles right now
Offline
Architeckt, remove the sed line, that was a solution for a different package. That will undoubtedly cause an error as it will not match.
Other than that your PKGBUILD looks good - you may also have to move the export LDFLAGS line before the cmake command, I'm not to sure about that part.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
cd $srcdir/$pkgname-${pkgver/_/-} || return 1
#cmake -CMAKE_INSTALL_PREFIX="/usr". || return 1
patch CMakeLists.txt < $srcdir/CMakeLists.txt.patch || return 1
export LDFLAGS="-lGL"
cmake . || return 1
make || return 1
make DESTDIR=$pkgdir install || return 1
Would like to make friends beyond China area!
Offline
Thanks much, works perfectly.
Added it to the comments in the AUR.
Offline
Pages: 1