Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem cross compiling a program that uses libusb

Status
Not open for further replies.

priestnot

Member level 5
Member level 5
Joined
May 1, 2006
Messages
89
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
2,098
So I managed to compile the libusb-1.0.9 and the libusb-compat-0.1.4 to ARM and install in to my toolchain.

But I cannot cross compile the simple lsusb.c (in attach) program.

I am cross compiling using the following command:

Code:
arm-none-linux-gnueabi-gcc -Wall -W lsusb.c -o lsusb_exe -lusb-1.0
and it gives me the folowing errors:
Code:
edu@gimli:/media/GimliD/edu/workspaces/Tests/Cpp/X10/ARM/lsusb$ arm-none-linux-gnueabi-gcc -Wall -W lsusb.c -o lsusb_exe -lusb-1.0
/tmp/ccSqklgw.o: In function `main':
lsusb.c:(.text+0x378): undefined reference to `usb_init'
lsusb.c:(.text+0x37c): undefined reference to `usb_find_busses'
lsusb.c:(.text+0x380): undefined reference to `usb_find_devices'
lsusb.c:(.text+0x3ec): undefined reference to `usb_open'
lsusb.c:(.text+0x434): undefined reference to `usb_get_string_simple'
lsusb.c:(.text+0x49c): undefined reference to `usb_get_string_simple'
lsusb.c:(.text+0x504): undefined reference to `usb_get_string_simple'
lsusb.c:(.text+0x53c): undefined reference to `usb_close'
lsusb.c:(.text+0x604): undefined reference to `usb_busses'
collect2: ld returned 1 exit status


What am I doing wrong?
I tried the following diferences but with the same result:
Code:
arm-none-linux-gnueabi-gcc -Wall -W lsusb.c -o lsusb_exe -lusb-1.0 -L/opt/gcc-arm/arm-none-linux-gnueabi/lib -I /opt/gcc-arm/arm-none-linux-gnueabi/include/libusb-1.0
arm-none-linux-gnueabi-gcc -Wall -W lsusb.c -o lsusb_exe -lusb-1.0 -L/opt/gcc-arm/arm-none-linux-gnueabi/lib -I /opt/gcc-arm/arm-none-linux-gnueabi/include
arm-none-linux-gnueabi-gcc -Wall -W lsusb.c -o lsusb -lusb-1.0 -I/opt/gcc-arm/arm-none-linux-gnueabi/include
arm-none-linux-gnueabi-gcc -Wall -W lsusb.c -o lsusb -lusb-1.0 -I/opt/gcc-arm/arm-none-linux-gnueabi/include/libusb-1.0
arm-none-linux-gnueabi-gcc -Wall -W lsusb.c -o lsusb -lusb-1.0 -L/opt/gcc-arm/arm-none-linux-gnueabi/lib
 
Last edited:

Just drop the library revision. It should work.

arm-none-linux-gnueabi-gcc -Wall -W lsusb.c -o lsusb_exe -lusb
 
ust drop the library revision. It should work.

arm-none-linux-gnueabi-gcc -Wall -W lsusb.c -o lsusb_exe -lusb

Did you find this post helpful? Click:

Thanks
I solved my problem.

i started using emdebian and instead of -lusb-1.0 i started using -lusb

That solved the problem thanks for your he
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top