Toolchain (Win) for Raspberry (Jessie) doesn't search at OpenCV lib path given

Sysprogs forums Forums Other tools & products Toolchain (Win) for Raspberry (Jessie) doesn't search at OpenCV lib path given

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #11262
    demonbots
    Participant
    Hi,
    
    I am cross compiling on Windows (Eclipse) for the target Raspberry Pi (Jessie). I have used the toolchain (raspberry-gcc-4.9.2-r4) from http://gnutoolchains.com/raspberry/.
    I was able to successfully compile and run a simple "Hello World" program on Windows and run it on the Pi.
    
    However, I ran into some trouble when I tried to compile a program that uses OpenCV3200 as an external lib.
    
    I compiled and installed OpenCV3200 on the raspberry pi and then synchronised Sysroot over to my windows host machine.
    
    Now upon trying to build, I am able to compile the program without errors however the linker fails with the error saying its unable to find the opencv libs.
    
    For some reason, the linker is ignoring the Lib Path that I pass to it with the -L option and instead uses different library paths.
    
    Please see the output of the compiler and linker below.
    
    make all 
    'Building file: ../bas.cpp'
    'Invoking: Cross G++ Compiler'
    arm-linux-gnueabihf-g++ -I"C:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\local\include" -O0 -g3 -Wall -c -fmessage-length=0 -v -MMD -MP -MF"bas.d" -MT"bas.o" -o "bas.o" "../bas.cpp"
    Using built-in specs.
    COLLECT_GCC=arm-linux-gnueabihf-g++
    Target: arm-linux-gnueabihf
    Configured with: ../gcc-4.9.2/src/configure --enable-win32-registry=SysGCC-arm-linux-gnueabihf-4.9.2 --prefix /q/gnu/linux/raspberry-jessie/out/ --disable-nls --without-libiconv-prefix --with-sysroot=/q/gnu/linux/raspberry-jessie/out/arm-linux-gnueabihf/sysroot --enable-languages=c,c++ --enable-shared --enable-linker-build-id --without-included-gettext --enable-threads=posix --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --with-arch-directory=arm --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --target arm-linux-gnueabihf
    Thread model: posix
    gcc version 4.9.2 (GCC) 
    COLLECT_GCC_OPTIONS='-I' 'C:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\local\include' '-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-v' '-MMD' '-MP' '-MF' 'bas.d' '-MT' 'bas.o' '-o' 'bas.o' '-shared-libgcc' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp' '-mtls-dialect=gnu'
     c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/4.9/cc1plus.exe -quiet -v -I C:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\local\include -imultilib . -imultiarch arm-linux-gnueabihf -iprefix c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/ -isysroot c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot -MMD bas.d -MF bas.d -MP -MT bas.o -dD -D_GNU_SOURCE ../bas.cpp -quiet -dumpbase bas.cpp -march=armv6 -mfloat-abi=hard -mfpu=vfp -mtls-dialect=gnu -auxbase-strip bas.o -g3 -O0 -Wall -version -fmessage-length=0 -o C:\Users\JDas\AppData\Local\Temp\ccM8oBVP.s
    GNU C++ (GCC) version 4.9.2 (arm-linux-gnueabihf)
     compiled by GNU C version 4.8.1, GMP version 4.2.4, MPFR version 2.4.1, MPC version 0.8
    GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
    ignoring nonexistent directory "c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/arm-linux-gnueabihf/c++/4.9/arm-linux-gnueabihf"
    ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9"
    ignoring nonexistent directory "C:/MinGW/msys/1.0/include/arm-linux-gnueabihf/c++/4.9/."
    ignoring nonexistent directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/arm-linux-gnueabihf/c++/4.9"
    ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9/backward"
    ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/include"
    ignoring nonexistent directory "c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include/arm-linux-gnueabihf/arm-linux-gnueabihf"
    ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/include-fixed"
    ignoring duplicate directory "c:/sysgcc/raspberry/lib/gcc/../../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include"
    ignoring duplicate directory "c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include/arm-linux-gnueabihf"
    #include "..." search starts here:
    #include <...> search starts here:
     C:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\local\include
     c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9
     c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include/c++/4.9/backward
     c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/include
     c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/include-fixed
     c:\sysgcc\raspberry\bin\../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/include
     c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include/arm-linux-gnueabihf
     c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot/usr/include
    End of search list.
    GNU C++ (GCC) version 4.9.2 (arm-linux-gnueabihf)
     compiled by GNU C version 4.8.1, GMP version 4.2.4, MPFR version 2.4.1, MPC version 0.8
    GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
    Compiler executable checksum: 77a52a28e20292d776f27f30cc5b625f
    COLLECT_GCC_OPTIONS='-I' 'C:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\local\include' '-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-v' '-MMD' '-MP' '-MF' 'bas.d' '-MT' 'bas.o' '-o' 'bas.o' '-shared-libgcc' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp' '-mtls-dialect=gnu'
     c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/bin/as.exe -v -I C:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\local\include -march=armv6 -mfloat-abi=hard -mfpu=vfp -meabi=5 -o bas.o C:\Users\JDas\AppData\Local\Temp\ccM8oBVP.s
    GNU assembler version 2.25 (arm-linux-gnueabihf) using BFD version (GNU Binutils) 2.25
    COMPILER_PATH=c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/4.9/;c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/;c:/sysgcc/raspberry/bin/../libexec/gcc/;c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/bin/
    LIBRARY_PATH=c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/;c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/;c:/sysgcc/raspberry/bin/../lib/gcc/;c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/lib/;c:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/lib/arm-linux-gnueabihf/;c:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/lib/;c:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/usr/lib/arm-linux-gnueabihf/;c:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/usr/lib/
    COLLECT_GCC_OPTIONS='-I' 'C:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\local\include' '-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-v' '-MMD' '-MP' '-MF' 'bas.d' '-MT' 'bas.o' '-o' 'bas.o' '-shared-libgcc' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp' '-mtls-dialect=gnu'
    'Finished building: ../bas.cpp'
    ' '
    'Building target: Basic'
    'Invoking: Cross G++ Linker'
    arm-linux-gnueabihf-g++ -L"C:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\local\lib" -o "Basic" ./bas.o -llibopencv_calib3d -llibopencv_core -llibopencv_highgui -llibopencv_imgcodecs -llibopencv_imgproc -llibopencv_video -llibopencv_videoio -llibopencv_videostab
    c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find -llibopencv_calib3d
    c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find -llibopencv_core
    c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find -llibopencv_highgui
    c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find -llibopencv_imgcodecs
    c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find -llibopencv_imgproc
    c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find -llibopencv_video
    c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find -llibopencv_videoio
    c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find -llibopencv_videostab
    collect2.exe: error: ld returned 1 exit status
    make: *** [Basic] Error 1
    
    I updated the ld.so.config file but that didn't help either. So now I am a bit unsure of what else I can do to get the linker to look at the correct directory.
    
    Any help would be really appreciated.
    
    Thanks in advance
    Regards
    JD
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.