Libusb not found

Hi all, I have to port a Linux i386 application to a ColibriT30 board. When I try to compile I get a cannot find -lusb error.
How can I solve this?

Can you clarify the steps you follow for compilation?

I set the ARCH, PATH and CROSS_COMPILE variables then run make on my Makefile.
Maybe I need to modify some path, but i’m not sure.
I get the same error on a Colibri iMX6 module and solved adding the library via an open-embedded recipe.
Actually I’m still a bit confused about using Open Embedded or not!

Note that our image distribute with libusb-1.0, which is a different library name all together. I think the libusb developer moved to this name since they had to break backward compatibility. Depending on what APIs you exactly use, it might work with -lusb-1.0. Otherwise you probably won’t come around to build a new image with libusb…

Thank for your reply, I still get the same error using -lusb-1.0:

/home/toradex/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/…/lib/gcc/arm-linux-gnueabihf/4.9.3/…/…/…/…/arm-linux-gnueabihf/bin/ld:
cannot find -lusb-1.0

I guess in that case the library is not in your search path.

I really recommend to use a OpenEmbedded SDK. It comes with an environment script which sets up all paths for you. Building one is rather easy, it just takes a while:

Ok, I’ll try!
But, just to understand, my Makefile include

OECORE_TARGET_SYSROOT ?= $(HOME)/ColibriT30/Colibri_T30_LinuxImageV2.6/rootfs/

and

LIBRARY_PATH = -L$(OECORE_TARGET_SYSROOT)usr/lib -Wl,-rpath-link,$(OECORE_TARGET_SYSROOT)usr/lib -L$(OECORE_TARGET_SYSROOT)lib -Wl,-rpath-link,$(OECORE_TARGET_SYSROOT)lib -Wl,--allow-shlib-undefined

and if I search with the terminal i get the following:

toradex@ubuntu:~$ ls -la ~/ColibriT30/Colibri_T30_LinuxImageV2.6/rootfs/lib | grep libusb
lrwxrwxrwx  1 root root      19 Jun 24 16:37 libusb-1.0.so.0 -> libusb-1.0.so.0.1.0
-rwxr-xr-x  1 root root   60732 Jun 24 16:37 libusb-1.0.so.0.1.0

Do not understand what I’m doing wrong!

I’m trying to do a bitbake building but it seems to hang at Parsing recipes!
I tried both a

bitbake -k angstrom-lxde-image

and a

bitbake core-minimal-image
but in the first attempt it hangs at 99%, in the second at 83%.
Then I tried with
bitbake -c clean python
but it hangs again at 83%!!! If I try to stop the process with Ctrl+C i got:

toradex@ubuntu:~/oe-core/build$ bitbake -c clean python
Parsing recipes: 83% |############################################################################################################################## | ETA: 00:00:44
Keyboard Interrupt, closing down…

ERROR: Timeout while attempting to communicate with bitbake server

That looks good to me, are you sure LIBRARY_PATH is part of your linker command? Can you post the output of the failing compilation step?

What do you mean by it “hangs”? How is the CPU at that moment? What is the console output? Note that OpenEmbedded does build a lot in the background, so this commands are expected to take up to several hours, depending on you machines capacity…

Ok, I get it!! I was compiling on a Virtual Machine and I had to set its memory to 4 GB to end to build process!

Still some confusion, I started development with the “Colibri_T30_LinuxImageV2.6” and recompiled the kernel source to get the clock output of the CIF module (as reported here) using the gcc-linaro toolchain.
Now that I have rebuild all using the “openembedded way” what I have to do now to reply that configuration?? Sorry for the question but I’m really not an expert!
Thanks all for the help!!!