Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: -lusb cross compile

-lusb cross compile 3 months 2 weeks ago #11351

  • seec
  • seec's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 84
  • Karma: 0
hi

I try to cross compile a project with usb driver in it.

Proview5.9
dev station lubuntu20 64bits
raspberry pi as run station

On dev station installed libusb-dev
in pwrp directory object-module add -lusb (works in other project without cross compile)

use this make file: (works for other projects without usb)





error from compiler or linker
Error: cannot find -lusb

make file:






cees
Attachments:
Last Edit: 3 months 2 weeks ago by seec.
The administrator has disabled public write access.

-lusb cross compile 3 months 2 weeks ago #11352

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 2961
  • Karma: 0
Hi cees,

You need a libusb archive compiled for ARM. It doesn't come with the cross compiler and the x86 version you have installed doesn't help much. You can probably find it on your target node and copy it to some place where the cross compiler can find it.

/Claes
The administrator has disabled public write access.

-lusb cross compile 3 months 2 weeks ago #11354

  • seec
  • seec's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 84
  • Karma: 0
Hi Claes

I changes my program with lib

#include <libusb-1.0/libusb.h>

in the term. window i got this errors:

/usr/lib/gcc-cross/arm-linux-gnueabihf/9/../../../../arm-linux-gnueabihf/bin/ld: /usr/local/pwrp/niproj/bld/arm_linux/obj/rt_io_m_ni_usb_6501_driver.o: in function `niusb6501_DEVICE_FIND_and_OPEN':
/usr/local/pwrp/niproj/src/appl/rt_io_m_ni_usb_6501_driver.c:84: undefined reference to `libusb_get_string_descriptor_ascii'


what have i to do?
.so file do i need (?? usr/lib/arm-linux-gnueabihf/libusb.so from rpi)
were put it on my dev. station (??? /usr/include/libusb-1.0/arm/libusb.so)
and changes in my .mk file and (add in line cin :=?? -I/usr/include/libusb-1.0/arm -lusb1.0)
change link file (?? -lusb -> -lusb1.0)

Cees
The administrator has disabled public write access.

-lusb cross compile 3 months 2 weeks ago #11355

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 2961
  • Karma: 0
Hi cees,

I'm not an expert on libusb but I don't think you should mix libusb and libusb-1.0. If you decide to use libusb-1.0 you should install libusb-1.0 and link with -lusb-1.0, and also copy libusb-1.0 from the rpi. Make sure you copy the real so-file because so-files are often links to more specific version so-files. And you may have to create new link files with 'ln -s'.

By running the cross compiler with -v you can see which library paths the compiler uses. You can also add new paths with -L, but there should not be any path specified in -l.

/Claes
The administrator has disabled public write access.

-lusb cross compile 3 months 2 weeks ago #11357

  • seec
  • seec's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 84
  • Karma: 0
Hi



I don't know if my application is still working after changing usblib to 1.0,
so i go back to rpi programming with no crosscompiling to get first everything working under pwr5.9.
And then I try crosscompiling again.

cees
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.435 seconds