Cross G++ Linker et libmongoc
Bonjour à tous,
je cherche à utiliser Mongodb dans un projet c/c++ destiné à être exécuté sur une Raspberry Pi (Debian Jessy).
Quelque détails sur mon environnement :
Citation:
IDE : Eclipse neon.2
Tools chain : arm-linux-gnueabihf (SysGCC)
Les fichiers libmongoc-1.0.so et libbson-1.0.so sont présent :
Sur mon pc dans -> C:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\local\lib
Sur ma Raspberry -> \usr\local\lib
Lorsque je compile mon projet j'ai l'erreur suivant :
Citation:
22:41:33 **** Incremental Build of configuration Debug for project R3Pi.Data ****
make all
'Building target: libR3Pi.Data.so'
'Invoking: Cross G++ Linker'
arm-linux-gnueabihf-g++ -v -L"C:\Users\MOI\workspace_RaspberryPi\R3Pi.Communication" -L"C:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\local\lib" -L"C:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\lib\arm-linux-gnueabihf" -L"C:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\lib" -L"C:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\lib\arm-linux-gnueabihf" -L"C:\Users\MOI\workspace_RaspberryPi\R3Pi.Data" -shared -o "libR3Pi.Data.so" ./src/Infrastructure/DbFactory.o ./src/Infrastructure/RepositoryBase.o ./src/BootLoader.o -lz -lm -lrt -llibmongoc-1.0 -ldl -lpthread
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-g++
COLLECT_LTO_WRAPPER=c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/4.9/lto-wrapper.exe
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)
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='-v' '-LC:\Users\MOI\workspace_RaspberryPi\R3Pi.Communication' '-LC:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\local\lib' '-LC:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\lib\arm-linux-gnueabihf' '-LC:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\lib' '-LC:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\lib\arm-linux-gnueabihf' '-LC:\Users\MOI\workspace_RaspberryPi\R3Pi.Data' '-shared' '-o' 'libR3Pi.Data.so' '-shared-libgcc' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp' '-mtls-dialect=gnu'
c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/4.9/collect2.exe -plugin c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/4.9/liblto_plugin-0.dll -plugin-opt=c:/sysgcc/raspberry/bin/../libexec/gcc/arm-linux-gnueabihf/4.9/lto-wrapper.exe -plugin-opt=-fresolution=C:\Users\MOI\AppData\Local\Temp\ccSrLS1n.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s --sysroot=c:\sysgcc\raspberry\bin\../arm-linux-gnueabihf/sysroot --build-id --eh-frame-hdr -shared -dynamic-linker /lib/ld-linux-armhf.so.3 -X --hash-style=gnu -m armelf_linux_eabi -o libR3Pi.Data.so c:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/usr/lib/arm-linux-gnueabihf/crti.o c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/lib/crtbeginS.o -LC:\Users\MOI\workspace_RaspberryPi\R3Pi.Communication -LC:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\local\lib -LC:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\lib\arm-linux-gnueabihf -LC:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\usr\lib -LC:\SysGCC\Raspberry\arm-linux-gnueabihf\sysroot\lib\arm-linux-gnueabihf -LC:\Users\MOI\workspace_RaspberryPi\R3Pi.Data -Lc:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9 -Lc:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf -Lc:/sysgcc/raspberry/bin/../lib/gcc -Lc:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/lib -Lc:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/lib/arm-linux-gnueabihf -Lc:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/lib -Lc:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/usr/lib/arm-linux-gnueabihf -Lc:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/usr/lib ./src/Infrastructure/DbFactory.o ./src/Infrastructure/RepositoryBase.o ./src/BootLoader.o -lz -lrt -llibmongoc-1.0 -ldl -lpthread -lstdc++ -lm -lgcc_s -lc -lgcc_s c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/lib/crtendS.o c:/sysgcc/raspberry/bin/../arm-linux-gnueabihf/sysroot/usr/lib/arm-linux-gnueabihf/crtn.o
c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find -llibmongoc-1.0
collect2.exe: error: ld returned 1 exit status
make: *** [libR3Pi.Data.so] Error 1
22:41:34 Build Finished (took 396ms)
Je n'arrive pas à comprendre pourquoi il ne trouve pas la librairie ?
Lors que j'ai installé la librairies sur ma Raspberry j'ai eu le message suivant :
Citation:
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------