Forum » Programiranje » [Code:Blocks, c++] Program ne najde knjižnice
[Code:Blocks, c++] Program ne najde knjižnice
gtu ::
Pozdravljeni,
soočam se s težavo pri programiranju v Code:Blocks.
Program se uspešno prevede, pri zagonu pa reče, da ne ne najde določene knjižnice, ki bi jo rad uporabil.
Mislim, da so nastavitve linkerja in compilerja nastavljene vredu, ker sem dodal vse možne poti in knjižnice ki naj bi jih program rabil.
Ima to opraviti s premenljivkami okolja?
V LD_LIBRARAY_PATH sem tudi dodal poti do knižnic, vendar nič ne pomaga.
Hvala za nasvete!
Lp
soočam se s težavo pri programiranju v Code:Blocks.
Platforma: nVidia Jetson ARM
uporabljene knjižnice: OpenCV, BaslerSDK, GigEApi
Program se uspešno prevede, pri zagonu pa reče, da ne ne najde določene knjižnice, ki bi jo rad uporabil.
Mislim, da so nastavitve linkerja in compilerja nastavljene vredu, ker sem dodal vse možne poti in knjižnice ki naj bi jih program rabil.
Ima to opraviti s premenljivkami okolja?
V LD_LIBRARAY_PATH sem tudi dodal poti do knižnic, vendar nič ne pomaga.
Hvala za nasvete!
Lp
Mavrik ::
Kaj ti pokaže "ldd tvoj_program"?
Nasvet: Naslednjič napiši TOČNO na katerem OSu delaš, težko ti ljudje pomagajo če jim ne podaš informacij, ki so pomembne. Recimo operacijski sistem, prevajalnik, verzija prevajalnika, celoten output prevajanja....
Nasvet: Naslednjič napiši TOČNO na katerem OSu delaš, težko ti ljudje pomagajo če jim ne podaš informacij, ki so pomembne. Recimo operacijski sistem, prevajalnik, verzija prevajalnika, celoten output prevajanja....
The truth is rarely pure and never simple.
Randomness ::
Napiši, kaj ti izpiše 'echo $LD_LIBRARY_PATH' v terminalu, v katerem poženeš svoj program.
gtu ::
Os:
Linux4Tegra R21.3 (Ubuntu) (Linux 3.10.40-ged4f697) armv7l
Cmake 2.8.12.2
C++ compiler 4.8.2
LD_LIBRARY_PATH vrne:
in pa še ouput prevajanja:
Prevede vredu, pri zagonu pa zajamra.
LP
Linux4Tegra R21.3 (Ubuntu) (Linux 3.10.40-ged4f697) armv7l
Cmake 2.8.12.2
C++ compiler 4.8.2
LD_LIBRARY_PATH vrne:
/opt/pylon4/lib:/opt/pylon4/genicam/bin/Linux32_ARM:/opt/pylon4/genicam/bin/Linux32_ARM/GenApi/Generic:/usr/local/cuda-6.5/lib
in pa še ouput prevajanja:
-------------- Build: Debug in CVtest (compiler: GNU GCC Compiler)--------------- g++ -g -Wl,-E -I/usr/local/include -I/opt/pylon4/include -I/opt/pylon4/genicam/library/CPP/include -c /home/ubuntu/Documents/CVtest/main.cpp -o obj/Debug/main.o g++ -L/usr/local/lib -L/opt/pylon4/lib -L/opt/pylon4/genicam/library/CPP/lib/Linux32_ARM -o bin/Debug/CVtest obj/Debug/main.o /usr/local/lib/libmodbus.so /usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_cudaarithm.so /usr/local/lib/libopencv_cudabgsegm.so /usr/local/lib/libopencv_cudacodec.so /usr/local/lib/libopencv_cudafeatures2d.so /usr/local/lib/libopencv_cudafilters.so /usr/local/lib/libopencv_cudaimgproc.so /usr/local/lib/libopencv_cudalegacy.so /usr/local/lib/libopencv_cudaobjdetect.so /usr/local/lib/libopencv_cudaoptflow.so /usr/local/lib/libopencv_cudastereo.so /usr/local/lib/libopencv_cudawarping.so /usr/local/lib/libopencv_cudev.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_hal.a /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgcodecs.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_shape.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_superres.so /usr/local/lib/libopencv_ts.a /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videoio.so /usr/local/lib/libopencv_videostab.so /opt/pylon4/genicam/library/CPP/lib/Linux32_ARM/liblog4cpp-static_gcc43_v2_3.a /opt/pylon4/lib/pylon-libusb-1.0.so /opt/pylon4/lib/libXerces-C_gcc43_v2_7_1.so /opt/pylon4/lib/libuxapi-4.0.0.so /opt/pylon4/lib/libuxapi.so /opt/pylon4/lib/libpylonutility-4.0.0.so /opt/pylon4/lib/libpylonutility.so /opt/pylon4/lib/libpylongigesupp-4.0.0.so /opt/pylon4/lib/libpylongigesupp.so /opt/pylon4/lib/libpylonbase-4.0.0.so /opt/pylon4/lib/libpylonbase.so /opt/pylon4/lib/libgxapi-4.0.0.so /opt/pylon4/lib/libgxapi.so /opt/pylon4/genicam/bin/Linux32_ARM/libMathParser_gcc43_v2_3.so /opt/pylon4/genicam/bin/Linux32_ARM/libLog_gcc43_v2_3.so /opt/pylon4/genicam/bin/Linux32_ARM/liblog4cpp_gcc43_v2_3.so /opt/pylon4/genicam/bin/Linux32_ARM/libGenApi_gcc43_v2_3.so /opt/pylon4/genicam/bin/Linux32_ARM/libGCBase_gcc43_v2_3.so Output file is bin/Debug/CVtest with size 55.86 KB Process terminated with status 0 (0 minute(s), 2 second(s)) 0 error(s), 0 warning(s) (0 minute(s), 2 second(s)) -------------- Run: Debug in CVtest (compiler: GNU GCC Compiler)--------------- Checking for existence: /home/ubuntu/Documents/CVtest/bin/Debug/CVtest Executing: xterm -T CVtest -e /usr/bin/cb_console_runner LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. /home/ubuntu/Documents/CVtest/bin/Debug/CVtest (in /home/ubuntu/Documents/CVtest/.)
Prevede vredu, pri zagonu pa zajamra.
LP
Mavrik ::
LDDja, ki ti pove kaj sploh tvoj app išče pa ti nekak ni uspelo pognat? O.o
The truth is rarely pure and never simple.
gtu ::
ubuntu@tegra-ubuntu:~/Documents/CVtest/bin/Release$ ldd CVtest libopencv_core.so.3.0 => /usr/local/lib/libopencv_core.so.3.0 (0xb6c66000) libopencv_highgui.so.3.0 => /usr/local/lib/libopencv_highgui.so.3.0 (0xb6c3c000) libopencv_imgcodecs.so.3.0 => /usr/local/lib/libopencv_imgcodecs.so.3.0 (0xb6b27000) libopencv_videoio.so.3.0 => /usr/local/lib/libopencv_videoio.so.3.0 (0xb6b01000) libpylonbase-4.0.0.so => /opt/pylon4/lib/libpylonbase-4.0.0.so (0xb695c000) libpylonutility-4.0.0.so => /opt/pylon4/lib/libpylonutility-4.0.0.so (0xb6744000) libGCBase_gcc43_v2_3.so => /opt/pylon4/genicam/bin/Linux32_ARM/libGCBase_gcc43_v2_3.so (0xb6728000) libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb667d000) libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb665c000) libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6575000) /lib/ld-linux-armhf.so.3 (0xb6f1b000) libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb6559000) libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb654e000) libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6533000) librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6525000) libcudart.so.6.5 => /usr/local/cuda/lib/libcudart.so.6.5 (0xb64dc000) libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb646f000) libQt5Core.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5 (0xb613c000) libQt5Gui.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Gui.so.5 (0xb5eae000) libQt5Widgets.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Widgets.so.5 (0xb5ae3000) libQt5Test.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Test.so.5 (0xb5ac0000) libopencv_imgproc.so.3.0 => /usr/local/lib/libopencv_imgproc.so.3.0 (0xb586c000) libjpeg.so.8 => /usr/lib/arm-linux-gnueabihf/libjpeg.so.8 (0xb582d000) libpng12.so.0 => /lib/arm-linux-gnueabihf/libpng12.so.0 (0xb580d000) libtiff.so.5 => /usr/lib/arm-linux-gnueabihf/libtiff.so.5 (0xb57b2000) libjasper.so.1 => /usr/lib/arm-linux-gnueabihf/libjasper.so.1 (0xb5771000) libdc1394.so.22 => /usr/lib/arm-linux-gnueabihf/libdc1394.so.22 (0xb5703000) libv4l1.so.0 => /usr/lib/arm-linux-gnueabihf/libv4l1.so.0 (0xb56f6000) libv4l2.so.0 => /usr/lib/arm-linux-gnueabihf/libv4l2.so.0 (0xb56e3000) libavcodec.so.54 => /usr/lib/arm-linux-gnueabihf/neon/vfp/libavcodec.so.54 (0xb4d56000) libavformat.so.54 => /usr/lib/arm-linux-gnueabihf/neon/vfp/libavformat.so.54 (0xb4c8f000) libavutil.so.52 => /usr/lib/arm-linux-gnueabihf/neon/vfp/libavutil.so.52 (0xb4c6c000) libswscale.so.2 => /usr/lib/arm-linux-gnueabihf/neon/vfp/libswscale.so.2 (0xb4c44000) libGenApi_gcc43_v2_3.so => /opt/pylon4/genicam/bin/Linux32_ARM/libGenApi_gcc43_v2_3.so (0xb4993000) libXerces-C_gcc43_v2_7_1.so => /opt/pylon4/lib/libXerces-C_gcc43_v2_7_1.so (0xb463e000) libLog_gcc43_v2_3.so => /opt/pylon4/genicam/bin/Linux32_ARM/libLog_gcc43_v2_3.so (0xb4630000) libicui18n.so.52 => /usr/lib/arm-linux-gnueabihf/libicui18n.so.52 (0xb44da000) libicuuc.so.52 => /usr/lib/arm-linux-gnueabihf/libicuuc.so.52 (0xb43dc000) libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0xb4314000) libharfbuzz.so.0 => /usr/lib/arm-linux-gnueabihf/libharfbuzz.so.0 (0xb42d3000) libGLESv2.so.2 => /usr/lib/arm-linux-gnueabihf/tegra-egl/libGLESv2.so.2 (0xb42bd000) libgobject-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgobject-2.0.so.0 (0xb427f000) libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0xb4199000) liblzma.so.5 => /lib/arm-linux-gnueabihf/liblzma.so.5 (0xb4179000) libjbig.so.0 => /usr/lib/arm-linux-gnueabihf/libjbig.so.0 (0xb4167000) libraw1394.so.11 => /usr/lib/arm-linux-gnueabihf/libraw1394.so.11 (0xb4155000) libusb-1.0.so.0 => /lib/arm-linux-gnueabihf/libusb-1.0.so.0 (0xb413e000) libv4lconvert.so.0 => /usr/lib/arm-linux-gnueabihf/libv4lconvert.so.0 (0xb40c8000) libxvidcore.so.4 => /usr/lib/arm-linux-gnueabihf/libxvidcore.so.4 (0xb3feb000) libx264.so.142 => /usr/lib/arm-linux-gnueabihf/libx264.so.142 (0xb3eb9000) libvpx.so.1 => /usr/lib/arm-linux-gnueabihf/vfp/neon/libvpx.so.1 (0xb3d33000) libvorbisenc.so.2 => /usr/lib/arm-linux-gnueabihf/libvorbisenc.so.2 (0xb3bc6000) libvorbis.so.0 => /usr/lib/arm-linux-gnueabihf/libvorbis.so.0 (0xb3b9c000) libtheoraenc.so.1 => /usr/lib/arm-linux-gnueabihf/libtheoraenc.so.1 (0xb3b66000) libtheoradec.so.1 => /usr/lib/arm-linux-gnueabihf/libtheoradec.so.1 (0xb3b4f000) libspeex.so.1 => /usr/lib/arm-linux-gnueabihf/libspeex.so.1 (0xb3b35000) libschroedinger-1.0.so.0 => /usr/lib/arm-linux-gnueabihf/libschroedinger-1.0.so.0 (0xb3aa4000) libopus.so.0 => /usr/lib/arm-linux-gnueabihf/libopus.so.0 (0xb3a72000) libopenjpeg.so.2 => /usr/lib/arm-linux-gnueabihf/libopenjpeg.so.2 (0xb3a55000) libmp3lame.so.0 => /usr/lib/arm-linux-gnueabihf/libmp3lame.so.0 (0xb39e8000) libgsm.so.1 => /usr/lib/arm-linux-gnueabihf/libgsm.so.1 (0xb39d6000) libva.so.1 => /usr/lib/arm-linux-gnueabihf/libva.so.1 (0xb39be000) librtmp.so.0 => /usr/lib/arm-linux-gnueabihf/librtmp.so.0 (0xb39a4000) libgnutls.so.26 => /usr/lib/arm-linux-gnueabihf/libgnutls.so.26 (0xb391e000) libbz2.so.1.0 => /lib/arm-linux-gnueabihf/libbz2.so.1.0 (0xb390a000) libMathParser_gcc43_v2_3.so => /opt/pylon4/genicam/bin/Linux32_ARM/libMathParser_gcc43_v2_3.so (0xb38f6000) liblog4cpp_gcc43_v2_3.so => /opt/pylon4/genicam/bin/Linux32_ARM/liblog4cpp_gcc43_v2_3.so (0xb38b4000) libicudata.so.52 => /usr/lib/arm-linux-gnueabihf/libicudata.so.52 (0xb2240000) libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0xb2208000) libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0xb21a1000) libgraphite2.so.3 => /usr/lib/arm-linux-gnueabihf/libgraphite2.so.3 (0xb2187000) libffi.so.6 => /usr/lib/arm-linux-gnueabihf/libffi.so.6 (0xb2179000) libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0xb215f000) libudev.so.1 => /lib/arm-linux-gnueabihf/libudev.so.1 (0xb214b000) libogg.so.0 => /usr/lib/arm-linux-gnueabihf/libogg.so.0 (0xb213d000) liborc-0.4.so.0 => /usr/lib/arm-linux-gnueabihf/liborc-0.4.so.0 (0xb20e5000) libgcrypt.so.11 => /lib/arm-linux-gnueabihf/libgcrypt.so.11 (0xb2081000) libtasn1.so.6 => /usr/lib/arm-linux-gnueabihf/libtasn1.so.6 (0xb206d000) libp11-kit.so.0 => /usr/lib/arm-linux-gnueabihf/libp11-kit.so.0 (0xb203f000) libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0xb2033000) libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0xb2027000) libcgmanager.so.0 => /lib/arm-linux-gnueabihf/libcgmanager.so.0 (0xb200a000) libnih.so.1 => /lib/arm-linux-gnueabihf/libnih.so.1 (0xb1ff1000) libnih-dbus.so.1 => /lib/arm-linux-gnueabihf/libnih-dbus.so.1 (0xb1fe1000) libdbus-1.so.3 => /lib/arm-linux-gnueabihf/libdbus-1.so.3 (0xb1faf000) libgpg-error.so.0 => /lib/arm-linux-gnueabihf/libgpg-error.so.0 (0xb1fa3000)
Randomness ::
Če prav razumem tvojo težavo, ti želiš pognati svoj program direktno iz Code::Blocks IDE-ja? Ker po tvojem ldd izpisu sodeč, bi se moral iz terminala, v katerem si pognal ldd, tvoj program pravilno zagnati. Vsaj ld očitno najde vse potrebne knjižnice. Kaj reče ukaz 'file /opt/pylon4/genicam/bin/Linux32_ARM/libGenApi_gcc43_v2_3.so'?
gtu ::
Tako nekako, ko kliknem na zeleno puščico za poganjanje programa v CodeBlocks, mi sicer program zažene, a ne najde dotične knjižnice.
Res mi je čudno.
Ukaz file... reče:
Res mi je čudno.
Ukaz file... reče:
/opt/pylon4/genicam/bin/Linux32_ARM/libGenApi_gcc43_v2_3.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, not stripped
Randomness ::
Pa si poskusil pognati program iz terminala - iz tistega, v katerem si prej pognal ldd tvoj_program? Problem je verjetno v tem, da Code::Blocks pri zagonu programa ne nastavi spremenljivke LD_LIBRARY_PATH. To je drugače možno rešiti na več načinov; najprej poskusi pognati Code::Block iz terminal, v katerem predhodno nastaviš spremenljivko LD_LIBRARY_PATH.
gtu ::
Prej nisem, ker sem mislil, da nima smisla, sedaj pa sem poizkusil še to in zadeva deluje! Se pravi, da je problem samo v tem, da CodeBlocks ne ve kam gledat.
Zgodovina sprememb…
- spremenil: gtu ()
Randomness ::
Tako je. Malo si poglej, kako "delujejo" okoljske spremenljivke in pa dynamic linker (man ld.so).
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | OpenSUSE pomočOddelek: Operacijski sistemi | 921 (814) | Redorange |
» | Ubuntu 7.04 + Pinnacle PCTV = slika super, zvoka ni - Linux n00b here (strani: 1 2 )Oddelek: Operacijski sistemi | 6790 (4231) | poweroff |
» | Google Earth odslej tudi za Linux (strani: 1 2 )Oddelek: Novice / Ostala programska oprema | 8272 (6450) | der_Alte |
» | RealPlayer ne mara mplayerjaOddelek: Operacijski sistemi | 1834 (1628) | kriko1 |
» | ET pro mod in cedegaOddelek: Igre | 1478 (1389) | PARTyZAN |