EddyAtPessac
EddyAtPessac

Reputation: 21

arm-linux-gnueabihf-g++ arm-linux-gnueabihf/bin/ld.exe: cannot find -llibxxx

I try to cross-compile for raspberry with arm-linux-gnueabihf-g++ under Windows. I succefuly try a "Hello Word" sample, but when I try to use pylon librarie "libpylonbase.so",
The compilation seem to be ok, but the linker tell that it doesn't find the "libpylonbase.so". I have add the absolute path to the library with -L, but it doesn't work. Why ld say that it don't find the library ? Here is the command and the result:

C:\SysGCC>raspberry\bin\arm-linux-gnueabihf-g++.exe -IC:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\pylon5\include 
-L"C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\pylon5\lib" -llibpylonbase.so -ggdb C:\DevCrossSoft\Grab_CameraEvents.cpp -o C:\DevCrossSoft\Grab_CameraEvents
In file included from c:\sysgcc\raspberry\arm-linux-gnueabihf\include\c++\6/vector:63:0,
                 from C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\pylon5\include/GenApi/Autovector.h:36,
                 from C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\pylon5\include/GenApi/Types.h:37,
                 from C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\pylon5\include/GenApi/IValue.h:35,
                 from C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\pylon5\include/GenApi/IEnumEntry.h:36,
                 from C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\pylon5\include/GenApi/IEnumeration.h:36,
                 from C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\pylon5\include/GenApi/Pointer.h:36,
                 from C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\pylon5\include/GenApi/GenApi.h:38,
                 from C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\pylon5\include/pylon/PylonIncludes.h:61,
                 from C:\DevCrossSoft\Grab_CameraEvents.cpp:38:
c:\sysgcc\raspberry\arm-linux-gnueabihf\include\c++\6/bits/stl_uninitialized.h: In function '_ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, 
_InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = long long int*; _ForwardIterator = long long int*; _Allocator = std::allocator<long long int>]':
c:\sysgcc\raspberry\arm-linux-gnueabihf\include\c++\6/bits/stl_uninitialized.h:304:69: note: parameter passing for argument of type 'std::move_iterator<long long int*>' 
will change in GCC 7.1
   _GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(__last), __result, __alloc);

  .....

c:/sysgcc/raspberry/bin/../lib/gcc/arm-linux-gnueabihf/6/../../../../arm-linux-gnueabihf/bin/ld.exe: cannot find -llibpylonbase.so
collect2.exe: error: ld returned 1 exit status

So I try to make Dir of this path, and the library is here. So why ld don't find it ?

C:\SysGCC>dir C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\pylon5\lib\libpylonbase.*
 Le volume dans le lecteur C s'appelle WIN7
 Le numéro de série du volume est 0A4E-F0C9
 Répertoire de C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\pylon5\lib

07/11/2018  08:30         1 604 756 libpylonbase.so
               1 fichier(s)        1 604 756 octets
               0 Rép(s)   5 874 581 504 octets libres

Upvotes: 1

Views: 2417

Answers (1)

EddyAtPessac
EddyAtPessac

Reputation: 21

In fact, to link correctly this library, I deleted the 'lib' prefix: To link "libpylonbase.so", the directive is "-lpylonbase". I hope it will be useful to many people...

Upvotes: 1

Related Questions