Wish List (generally ignored ;-), Brainstorming
Post Reply
ani.chelluri
Posts: 1
Joined: 19 Jun 2014, 11:21

usb-modeswitch for a PPC architecture running Monta vista di

Post by ani.chelluri » 19 Jun 2014, 11:34

Hi Experts,

I was trying to cross-compile the source for a PPC architecture device from my Linux x86 environment. I see that there is no configure file to pick thre environmental variables, and also the option to set the target architecture type is missing. Moreover, my target uses a different gcc. I was trying to give the gmake all /make all and was getting the following errors. :roll: :roll: :roll:


$ gmake all

cc -o usb_modeswitch usb_modeswitch.c -Wall `pkg-config --libs --cflags libusb-1.0`
Package libusb-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libusb-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libusb-1.0' found
In file included from usb_modeswitch.c:59:
usb_modeswitch.h:26:20: libusb.h: No such file or directory
usb_modeswitch.c:65: warning: "struct libusb_device_handle" declared inside parameter list
usb_modeswitch.c:65: warning: its scope is only this definition or declaration, which is probably not what you want
usb_modeswitch.c: In function `usb_bulk_io':
usb_modeswitch.c:70: warning: implicit declaration of function `libusb_bulk_transfer'
usb_modeswitch.c:75: error: `LIBUSB_ERROR_TIMEOUT' undeclared (first use in this function)
usb_modeswitch.c:75: error: (Each undeclared identifier is reported only once
usb_modeswitch.c:75: error: for each function it appears in.)
usb_modeswitch.c: At top level:
usb_modeswitch.c:81: error: syntax error before '*' token
usb_modeswitch.c: In function `usb_interrupt_io':
usb_modeswitch.c:87: warning: implicit declaration of function `libusb_interrupt_transfer'
usb_modeswitch.c:87: error: `handle' undeclared (first use in this function)
usb_modeswitch.c:87: error: `ep' undeclared (first use in this function)
usb_modeswitch.c:87: error: `bytes' undeclared (first use in this function)
usb_modeswitch.c:87: error: `size' undeclared (first use in this function)
usb_modeswitch.c:88: error: `timeout' undeclared (first use in this function)
usb_modeswitch.c:92: error: `LIBUSB_ERROR_TIMEOUT' undeclared (first use in this function)
usb_modeswitch.c: In function `main':
usb_modeswitch.c:427: error: storage size of 'descriptor' isn't known
usb_modeswitch.c:495: warning: implicit declaration of function `libusb_init'
usb_modeswitch.c:498: warning: implicit declaration of function `libusb_set_debug'
usb_modeswitch.c:531: warning: implicit declaration of function `libusb_get_device_address'
usb_modeswitch.c:532: warning: implicit declaration of function `libusb_get_bus_number'
usb_modeswitch.c:535: warning: implicit declaration of function `libusb_open'
usb_modeswitch.c:541: warning: implicit declaration of function `libusb_get_active_config_descriptor'
usb_modeswitch.c:545: error: dereferencing pointer to incomplete type
usb_modeswitch.c:550: warning: implicit declaration of function `libusb_get_device_descriptor'
usb_modeswitch.c:553: error: dereferencing pointer to incomplete type
usb_modeswitch.c:562: error: `LIBUSB_ENDPOINT_OUT' undeclared (first use in this function)
usb_modeswitch.c:564: error: `LIBUSB_ENDPOINT_IN' undeclared (first use in this function)
usb_modeswitch.c:565: warning: implicit declaration of function `libusb_free_config_descriptor'
usb_modeswitch.c:750: warning: implicit declaration of function `libusb_close'
usb_modeswitch.c:427: warning: unused variable `descriptor'
usb_modeswitch.c: In function `deviceDescription':
usb_modeswitch.c:811: error: storage size of 'descriptor' isn't known
usb_modeswitch.c:819: warning: implicit declaration of function `libusb_get_string_descriptor_ascii'
usb_modeswitch.c:811: warning: unused variable `descriptor'
usb_modeswitch.c: In function `deviceInquire':
usb_modeswitch.c:871: warning: implicit declaration of function `libusb_claim_interface'
usb_modeswitch.c:876: warning: implicit declaration of function `libusb_clear_halt'
usb_modeswitch.c:878: warning: passing arg 1 of `usb_bulk_io' from incompatible pointer type
usb_modeswitch.c:884: warning: passing arg 1 of `usb_bulk_io' from incompatible pointer type
usb_modeswitch.c:890: warning: passing arg 1 of `usb_bulk_io' from incompatible pointer type
usb_modeswitch.c:911: warning: implicit declaration of function `libusb_release_interface'
usb_modeswitch.c: In function `findMBIMConfig':
usb_modeswitch.c:925: warning: implicit declaration of function `libusb_get_device_list'
usb_modeswitch.c:932: error: storage size of 'descriptor' isn't known
usb_modeswitch.c:956: warning: implicit declaration of function `libusb_get_config_descriptor'
usb_modeswitch.c:957: error: dereferencing pointer to incomplete type
usb_modeswitch.c:958: error: dereferencing pointer to incomplete type
usb_modeswitch.c:959: error: dereferencing pointer to incomplete type
usb_modeswitch.c:960: error: dereferencing pointer to incomplete type
usb_modeswitch.c:932: warning: unused variable `descriptor'
usb_modeswitch.c: In function `usb_modeswitch.c:988: warning: implicit declaration of function `libusb_reset_device'
usb_modeswitch.c: In function `switchConfiguration':
usb_modeswitch.c:1085: warning: implicit declaration of function `libusb_set_configuration'
usb_modeswitch.c: In function `switchAltSetting':
usb_modeswitch.c:1103: warning: implicit declaration of function `libusb_set_interface_alt_setting'
usb_modeswitch.c: In function `switchHuaweiMode':
usb_modeswitch.c:1117: warning: implicit declaration of function `libusb_control_transfer'
usb_modeswitch.c:1117: error: `LIBUSB_REQUEST_TYPE_STANDARD' undeclared (first use in this function)
usb_modeswitch.c:1117: error: `LIBUSB_RECIPIENT_DEVICE' undeclared (first use in this function)
usb_modeswitch.c:1117: error: `LIBUSB_REQUEST_SET_FEATURE' undeclared (first use in this function)
usb_modeswitch.c: In function `switchSierraMode':
usb_modeswitch.c:1129: error: `LIBUSB_REQUEST_TYPE_VENDOR' undeclared (first use in this function)
usb_modeswitch.c:1130: error: `LIBUSB_ERROR_PIPE' undeclared (first use in this function)
usb_modeswitch.c: In function `switchKobilMode':
usb_modeswitch.c:1166: error: `LIBUSB_REQUEST_TYPE_VENDOR' undeclared (first use in this function)
usb_modeswitch.c:1166: error: `LIBUSB_RECIPIENT_DEVICE' undeclared (first use in this function)
usb_modeswitch.c:1166: error: `LIBUSB_ENDPOINT_IN' undeclared (first use in this function)
usb_modeswitch.c: In function `switchQuantaMode':
usb_modeswitch.c:1188: error: `LIBUSB_REQUEST_TYPE_VENDOR' undeclared (first use in this function)
usb_modeswitch.c:1188: error: `LIBUSB_RECIPIENT_DEVICE' undeclared (first use in this function)
usb_modeswitch.c:1188: error: `LIBUSB_ENDPOINT_IN' undeclared (first use in this function)
usb_modeswitch.c: In function `switchBlackberryMode':
usb_modeswitch.c:1200: error: `LIBUSB_REQUEST_TYPE_VENDOR' undeclared (first use in this function)
usb_modeswitch.c:1200: error: `LIBUSB_RECIPIENT_DEVICE' undeclared (first use in this function)
usb_modeswitch.c:1200: error: `LIBUSB_ENDPOINT_IN' undeclared (first use in this function)
usb_modeswitch.c: In function `switchPantechMode':
usb_modeswitch.c:1218: error: `LIBUSB_REQUEST_TYPE_VENDOR' undeclared (first use in this function)
usb_modeswitch.c:1218: error: `LIBUSB_RECIPIENT_DEVICE' undeclared (first use in this function)
usb_modeswitch.c: In function `switchActionMode':
usb_modeswitch.c:1243: error: `LIBUSB_REQUEST_TYPE_CLASS' undeclared (first use in this function)
usb_modeswitch.c:1243: error: `LIBUSB_RECIPIENT_INTERFACE' undeclared (first use in this function)
usb_modeswitch.c: In function `switchSequansMode':
usb_modeswitch.c:1294: error: `LIBUSB_REQUEST_TYPE_VENDOR' undeclared (first use in this function)
usb_modeswitch.c:1294: error: `LIBUSB_RECIPIENT_DEVICE' undeclared (first use in this function)
usb_modeswitch.c: In function `detachDriver':
usb_modeswitch.c:1425: warning: implicit declaration of function `libusb_kernel_driver_active'
usb_modeswitch.c:1426: error: `LIBUSB_ERROR_NOT_SUPPORTED' undeclared (first use in this function)
usb_modeswitch.c:1439: warning: implicit declaration of function `libusb_detach_kernel_driver'
usb_modeswitch.c: In function `sendMessage':
usb_modeswitch.c:1468: error: `LIBUSB_ERROR_NO_DEVICE' undeclared (first use in this function)
usb_modeswitch.c: In function `write_bulk':
usb_modeswitch.c:1594: warning: passing arg 1 of `usb_bulk_io' from incompatible pointer type
usb_modeswitch.c:1598: error: `LIBUSB_ERROR_NO_DEVICE' undeclared (first use in this function)
usb_modeswitch.c: In function `read_bulk':
usb_modeswitch.c:1608: warning: passing arg 1 of `usb_bulk_io' from incompatible pointer type
usb_modeswitch.c:1612: error: `LIBUSB_ERROR_NO_DEVICE' undeclared (first use in this function)
usb_modeswitch.c: In function `search_devices':
usb_modeswitch.c:1664: error: storage size of 'descriptor' isn't known
usb_modeswitch.c:1703: error: storage size of 'descriptor' isn't known
usb_modeswitch.c:1708: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1703: warning: unused variable `descriptor'
usb_modeswitch.c:1664: warning: unused variable `descriptor'
usb_modeswitch.c: In function `find_first_bulk_endpoint':
usb_modeswitch.c:1780: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1781: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1782: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1783: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1784: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1785: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1785: error: `LIBUSB_ENDPOINT_ADDRESS_MASK' undeclared (first use in this function)
usb_modeswitch.c:1785: error: `LIBUSB_TRANSFER_TYPE_BULK' undeclared (first use in this function)
usb_modeswitch.c:1786: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1786: error: `LIBUSB_ENDPOINT_DIR_MASK' undeclared (first use in this function)
usb_modeswitch.c:1787: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function `get_current_configuration':
usb_modeswitch.c:1802: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function `get_interface_class':
usb_modeswitch.c:1813: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1814: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1815: error: dereferencing pointer to incomplete type
gmake: *** [usb_modeswitch] Error 1


I also have libusb-dev installed.

PLEASE let me know how I can get this working. :) :)

Thanks in advance :mrgreen: :mrgreen:

Josh
Site Admin
Posts: 6569
Joined: 03 Nov 2007, 00:30

Re: usb-modeswitch for a PPC architecture running Monta vist

Post by Josh » 29 Jun 2014, 00:23

You may have libusb-dev installed, but it is not found ...

"usb_modeswitch.h:26:20: libusb.h: No such file or directory"

Post Reply