Recently I compiled ICU 49.1.2 on two systems - one Ubuntu and one Debian-based ("Wheezy" for the Raspberry Pi). The Ubuntu system works, but the RPi system reports an error when I try to run any of the ICU executables or when I link it in with my application:

me@raspberrypi ~/icu/source $ genrb -V 
genrb: error while loading shared libraries: libicudata.so.49: cannot open shared object file: No such file or directory

I've verified the libraries exist:

me@raspberrypi ~/icu/source $ find / -name 'libicudata.so*' 2>/dev/null
/usr/local/lib/libicudata.so
/usr/local/lib/libicudata.so.49.1.2
/usr/local/lib/libicudata.so.49

And that pkg-config confirms this:

me@raspberrypi ~/icu/source $ pkg-config --libs-only-L icu-uc
-L/usr/local/lib

I also made sure to run sudo ldconfig after installing ICU. I even tried running make check on the failing system:

LD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$LD_LIBRARY_PATH  ./../../bin/uconv -f ibm-37 ./samples/ibm-37-test.txt
./../../bin/uconv: can not initialize ICU.  status = U_FILE_ACCESS_ERROR
make[2]: *** [check-local] Error 1
make[2]: Leaving directory `/home/uli/icu/source/extra/uconv'
make[1]: *** [check-recursive] Error 2
make[1]: Leaving directory `/home/uli/icu/source/extra'
make: *** [check-recursive] Error 2

As far as I can tell, the systems are identical in terms of locations and presence of the necessary files. It just appears that the Debian-based Raspberry Pi insists on looking somewhere else (presumably /usr/lib) for libicudata.so instead of /usr/local/lib. I could change the --prefix on the ./configure script to fix the problem, but I'd like to understand why one system worked and the other did not.

Update

Well, I thought I could fix the problem by changing the '--prefix' parameter to the ./configure script, but it turns out that doesn't work. I have libicudata.so.49 in /usr/lib and /usr/local/lib, but ICU still can't find the libraries.

I also tried creating a "Hello World" program that just included the ICU libraries to see what would happen. Same failures:

me@raspberrypi ~ $ gcc -licudata -licuuc helloworld.c
me@raspberrypi ~ $ ./a.out
./a.out: error while loading shared libraries: libicudata.so.49: cannot open shared object file: No such file or directory
me@raspberrypi ~ $ ldd a.out
        /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0xb6f41000)
        libicudata.so.49 => not found
        libicuuc.so.49 => /usr/local/lib/libicuuc.so.49 (0xb6df8000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6cc9000)
        libicudata.so.49 => not found
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6caa000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6c9f000)
        libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6bd2000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6b61000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6b39000)
        /lib/ld-linux-armhf.so.3 (0xb6f4d000)

Update 2

I'm recompiling right now with the LDFLAGSICUDT flag commented out (The RPi is a little slow on the compile).

As for the other comment, here is the output from the file command:

me@raspberrypi ~ $ file /usr/local/lib/libicudata.so*
/usr/local/lib/libicudata.so:        symbolic link to `libicudata.so.49.1.2'
/usr/local/lib/libicudata.so.49:     symbolic link to `libicudata.so.49.1.2'
/usr/local/lib/libicudata.so.49.1.2: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, BuildID[sha1]=0xfb336da457f28964a6161af4d7b07902882d6fa8, not stripped
有帮助吗?

解决方案

I just took a look at the icu package on 12.04 LTS. It's an older version (4.8), but there the LDFLAGSICUDT flags are commented out in source/config/mh-linux and a comment states that linking it as data only would cause too many problems.

Commenting out LDFLAGSICUDT solves the problem.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top