2017-11-23 34 views
1

私はクロスコンパイルに別のアームプラットフォームとopencv2.4.9を成功裏にコンパイルしました。私はopencv3を使用したい、 contribモジュールが必要です。しかし、opencvを1週間クロスコンパイルしようとしましたが、zlib png jpeg xvid ffmpegはopencv-dependという名前のフォルダにクロスコンパイルされています。 私はOpenCVのを構成するためにcmakeのを使用する場合、私は、ZLIB PNG JPEGパスとファイルパスを編集したものLIBS私はcmakeにパスを渡したときlibz.so.1と他の2つのlibsを見つけることができません

ZLib:      /home/alinx/opencv-depend/lib/libz.so (ver 1.2.8) 
JPEG:      /home/alinx/opencv-depend/lib/libjpeg.so (ver 90) 
WEBP:      build (ver encoder: 0x020e) 
PNG:       /home/alinx/opencv-depend/lib/libpng.so (ver 1.6.18) 

を発見したcmakeの-guiの報告書が、私はメイクファイルを生成するとき、作り始めると、端末が返さこれらが認識できない理由を私はいくつかの検索この

[ 41%] Built target opencv_ts 
Linking CXX executable ../../bin/opencv_perf_core 
/opt/Xilinx/SDK/2015.4/gnu/arm/lin/bin/../lib/gcc/arm-xilinx-linux-gnueabi/4.9.2/../../../../arm-xilinx-linux-gnueabi/bin/ld: warning: libz.so.1, needed by ../../lib/libopencv_core.so.3.3.1, not found (try using -rpath or -rpath-link) 
/opt/Xilinx/SDK/2015.4/gnu/arm/lin/bin/../lib/gcc/arm-xilinx-linux-gnueabi/4.9.2/../../../../arm-xilinx-linux-gnueabi/bin/ld: warning: libjpeg.so.9, needed by ../../lib/libopencv_imgcodecs.so.3.3.1, not found (try using -rpath or -rpath-link) 
/opt/Xilinx/SDK/2015.4/gnu/arm/lin/bin/../lib/gcc/arm-xilinx-linux-gnueabi/4.9.2/../../../../arm-xilinx-linux-gnueabi/bin/ld: warning: libpng16.so.16, needed by ../../lib/libopencv_imgcodecs.so.3.3.1, not found (try using -rpath or -rpath-link) 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_core.so.3.3.1: undefined reference to `gzeof' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_core.so.3.3.1: undefined reference to `gzrewind' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_core.so.3.3.1: undefined reference to `gzopen' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_core.so.3.3.1: undefined reference to `gzclose' 
../../lib/libopencv_core.so.3.3.1: undefined reference to `gzgets' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
../../lib/libopencv_core.so.3.3.1: undefined reference to `gzputs' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_0' 
../../lib/libopencv_imgcodecs.so.3.3.1: undefined reference to `[email protected]_9.0' 
collect2: error: ld returned 1 exit status 
make[2]: *** [bin/opencv_perf_core] error 1 
make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] error 2 
make: *** [all] error 2 

ができますが、彼らが問題をクロスコンパイルではありませんが、私はlibにパスを割り当てたと思う?ここで私は完全なCmakeCacheファイルを与えます。

General configuration for OpenCV 3.3.1-dev ===================================== 
    Version control:    unknown 

    Extra modules: 
    Location (extra):   /home/lzx/Documents/opencv_contrib-master/modules 
    Version control (extra):  unknown 

    Platform: 
    Timestamp:     2017-11-23T13:23:11Z 
    Host:      Linux 4.4.0-98-generic x86_64 
    Target:      Linux arm 
    CMake:      2.8.12.2 
    CMake generator:    Unix Makefiles 
    CMake build tool:   /usr/bin/make 
    Configuration:    Release 

    CPU/HW features: 
    Baseline:     NEON FP16 
     requested:     DETECT 
     disabled:     VFPV3 NEON 

    C/C++: 
    Built as dynamic libs?:  YES 
    C++ Compiler:    /opt/Xilinx/SDK/2015.4/gnu/arm/lin/bin/arm-xilinx-linux-gnueabi-g++ (ver 4.9.2) 
    C++ flags (Release):   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG 
    C++ flags (Debug):   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -mfp16-format=ieee -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG 
    C Compiler:     /opt/Xilinx/SDK/2015.4/gnu/arm/lin/bin/arm-xilinx-linux-gnueabi-gcc 
    C flags (Release):   -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -mfp16-format=ieee -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG 
    C flags (Debug):    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -mfp16-format=ieee -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG 
    Linker flags (Release):  
    Linker flags (Debug):   
    ccache:      NO 
    Precompiled headers:   NO 
    Extra dependencies:   dl m pthread rt 
    3rdparty dependencies: 

    OpenCV modules: 
    To be built:     core flann imgproc ml objdetect photo video dnn imgcodecs shape videoio highgui superres ts features2d calib3d stitching videostab aruco 
    Disabled:     js world 
    Disabled by dependency:  - 
    Unavailable:     cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev java python2 python3 viz 

    GUI: 
    QT:       NO 
    GTK+:      NO 
    GThread :     NO 
    GtkGlExt:     NO 
    OpenGL support:    NO 
    VTK support:     NO 

    Media I/O: 
    ZLib:      /home/alinx/opencv-depend/lib/libz.so (ver 1.2.8) 
    JPEG:      /home/alinx/opencv-depend/lib/libjpeg.so (ver 90) 
    WEBP:      build (ver encoder: 0x020e) 
    PNG:       /home/alinx/opencv-depend/lib/libpng.so (ver 1.6.18) 
    TIFF:      NO 
    JPEG 2000:     build (ver 1.900.1) 
    OpenEXR:      NO 
    GDAL:      NO 
    GDCM:      NO 

    Video I/O: 
    DC1394 1.x:     NO 
    DC1394 2.x:     NO 
    FFMPEG:      NO 
     avcodec:     YES (ver 56.60.100) 
     avformat:     YES (ver 56.40.101) 
     avutil:     YES (ver 54.31.100) 
     swscale:     YES (ver 3.1.101) 
     avresample:    NO 
    GStreamer:     NO 
    OpenNI:      NO 
    OpenNI PrimeSensor Modules: NO 
    OpenNI2:      NO 
    PvAPI:      NO 
    GigEVisionSDK:    NO 
    Aravis SDK:     NO 
    UniCap:      NO 
    UniCap ucil:     NO 
    V4L/V4L2:     NO/YES 
    XIMEA:      NO 
    Xine:      NO 
    Intel Media SDK:    NO 
    gPhoto2:      NO 

    Parallel framework:   pthreads 

    Trace:       YES() 

    Other third-party libraries: 
    Use Intel IPP:    NO 
    Use Intel IPP IW:   NO 
    Use VA:      NO 
    Use Intel VA-API/OpenCL:  NO 
    Use Lapack:     NO 
    Use Eigen:     NO 
    Use Cuda:     NO 
    Use OpenCL:     NO 
    Use OpenVX:     NO 
    Use custom HAL:    YES (carotene (ver 0.0.1)) 

    Python 2: 
    Interpreter:     /usr/bin/python2.7 (ver 2.7.6) 

    Python 3: 
    Interpreter:     /usr/bin/python3.4 (ver 3.4.3) 

    Python (for build):   /usr/bin/python2.7 

    Java: 
    ant:       NO 
    JNI:       NO 
    Java wrappers:    NO 
    Java tests:     NO 

    Matlab:      Matlab not found or implicitly disabled 

    Documentation: 
    Doxygen:      NO 

    Tests and samples: 
    Tests:      YES 
    Performance tests:   YES 
    C/C++ Examples:    NO 

    Install path:     /home/lzx/Documents/opencv-install 

    cvconfig.h is in:    /home/lzx/Documents/opencv-master/build 
----------------------------------------------------------------- 

Configuring done 
Generating done 

およびそれらのLIBSは、私はあなたがどこ見つけるためにコンパイラに伝える任意のリンカーフラグを持っていない

:/home/alinx/opencv-depend/lib# ls 
libavcodec.a    libavutil.so   libpostproc.so 
libavcodec.so    libavutil.so.54   libpostproc.so.53 
libavcodec.so.56   libavutil.so.54.31.100 libpostproc.so.53.3.100 
libavcodec.so.56.60.100 libjpeg.a    libswresample.a 
libavdevice.a    libjpeg.la    libswresample.so 
libavdevice.so   libjpeg.so    libswresample.so.1 
libavdevice.so.56   libjpeg.so.9   libswresample.so.1.2.101 
libavdevice.so.56.4.100 libjpeg.so.9.0.0  libx264.so 
libavfilter.a    libpng16.a    libx264.so.148 
libavfilter.so   libpng16.la    libyasm.a 
libavfilter.so.5   libpng16.so    libz.a 
libavfilter.so.5.40.101 libpng16.so.16   libz.so 
libavformat.a    libpng16.so.16.18.0  libz.so.1 
libavformat.so   libpng.a    libz.so.1.2.8 
libavformat.so.56   libpng.la    pkgconfig 
libavformat.so.56.40.101 libpng.so 
libavutil.a    libpostproc.a 

答えて

0

アーム-ザイリンクスのlinux-gnueabiツールチェーンとクロスコンパイルしたものですリンクするのに必要なライブラリ

Linker flags (Release):  
Linker flags (Debug): 

必要なパスを追加すると、これを解決するのに役立ちます。例えばadd

-L/home/alinx/opencv-depend/lib 
関連する問題