我的工作雖然First Steps教程在POCO項目工地,我已經成功地構建了庫(Debian的Linux中,2.6.26,GCC 4.3.2),我的主目錄下的Linux運行時鏈接錯誤
~/Development/POCO
與位於
~/Development/POCO/lib/Linux/x86_64/lib
我的問題的共享庫是我建立的任何應用程序依賴這些庫只能從共享庫目錄中運行。
~/Development/POCO/lib/Linux/x86_64$ ldd ~/Development/Cloud/DateTimeSample/bin/Linux/x86_64/DateTime linux-vdso.so.1 => (0x00007fffe69fe000) libPocoFoundation.so.6 (0x00007fa8de44f000) libpthread.so.0 => /lib/libpthread.so.0 (0x00007fa8de233000) libdl.so.2 => /lib/libdl.so.2 (0x00007fa8de02f000) librt.so.1 => /lib/librt.so.1 (0x00007fa8dde26000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fa8ddb1a000) libm.so.6 => /lib/libm.so.6 (0x00007fa8dd897000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fa8dd680000) libc.so.6 => /lib/libc.so.6 (0x00007fa8dd32d000) /lib64/ld-linux-x86-64.so.2 (0x00007fa8de7e0000)
並且從該目錄運行DateTime將按您的預期工作。然而
~/Development/Cloud/DateTimeSample/bin/Linux/x86_64$ ldd DateTime linux-vdso.so.1 => (0x00007fff24dfe000) libPocoFoundation.so.6 => not found libpthread.so.0 => /lib/libpthread.so.0 (0x00007ffc1c7dd000) libdl.so.2 => /lib/libdl.so.2 (0x00007ffc1c5d9000) librt.so.1 => /lib/librt.so.1 (0x00007ffc1c3d0000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007ffc1c0c4000) libm.so.6 => /lib/libm.so.6 (0x00007ffc1be41000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007ffc1bc2a000) libc.so.6 => /lib/libc.so.6 (0x00007ffc1b8d7000) /lib64/ld-linux-x86-64.so.2 (0x00007ffc1c9f9000)
因此在運行任何其他目錄的結果中可執行
error while loading shared libraries: libPocoFoundation.so.6: cannot open shared object file: No such file or directory
望着從化妝過程的輸出,該目錄正確指定
g++ [blah] -L/home/npalko/Development/POCO/lib/Linux/x86_64 -lPocoFoundation
我試着將
LD_LIBRARY_PATH
設置爲
/home/npalko/Development/POCO/lib/Linux/x86_64,但它沒有改變任何東西。任何幫助將不勝感激!
啊,我的問題是,我已經錯誤地設置LD_LIBRARY_PATH。更多的是對Bash的誤解,而不是其他任何事情。非常感謝你的幫助! – 2009-09-30 19:37:47