Friday, August 13, 2010

Linking problems with LD_LIBRARY_PATH and Maemo/Scratchbox?

I just mentioned the same thing to Alexis, so I thought I'll write it down here so that anyone can find the solution if needed:

Sometimes when building Qt apps in Maemo/Scratchbox you'll notice that when you run ldd on your example app on the device it won't pick up your own build of QtWebKit.so but it'll always use the one in /usr/lib.

I recently heard about a neat trick to fix this:

The binary has a built-in rpath that makes the dynamic linker ignore LD_LIBRARY_PATH, but there's a little tool to fix it up. Just run "fakeroot apt-get install chrpath" in scratchbox and use "chrpath -d /path/to/your/testapp" to remove the rpath altogether. When you then run the binary on the device it'll respect LD_LIBRARY_PATH.

No comments:

Post a Comment