LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 02-15-2014, 11:51 AM   #1
latawaz
LQ Newbie
 
Registered: Feb 2014
Distribution: Slackware 14.1 64-bit
Posts: 14
Blog Entries: 1

Rep: Reputation: Disabled
Question Installation of usb_modeswitch on CentOS 6.5


I am trying to install a dongle(photon+ E398 to be precise).
I have come across usb_modeswitch and I am following http://www.draisberghof.de/usb_modeswitch/#download
Under Downloads, I have downloaded all the three tar files.
I am doing this:

Code:
tar -xvf usb-modeswitch-2.1.0.tar.bz2
cd usb-m*
make install
The above gives me
Code:
sed 's_!/usr/bin/tclsh_!'"/usr/bin/tclsh"'_' < usb_modeswitch.tcl > usb_modeswitch_dispatcher
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: error: libusb.h: No such file or directory
In file included from usb_modeswitch.c:59:
usb_modeswitch.h:56: warning: ‘struct libusb_device_handle’ declared inside parameter list
usb_modeswitch.h:56: warning: its scope is only this definition or declaration, which is probably not what you want
usb_modeswitch.h:57: warning: ‘struct libusb_config_descriptor’ declared inside parameter list
usb_modeswitch.c:65: warning: ‘struct libusb_device_handle’ declared inside parameter list
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: expected ‘)’ before ‘*’ token
usb_modeswitch.c: In function ‘main’:
usb_modeswitch.c:421: error: storage size of ‘descriptor’ isn’t known
usb_modeswitch.c:491: warning: implicit declaration of function ‘libusb_init’
usb_modeswitch.c:494: warning: implicit declaration of function ‘libusb_set_debug’
usb_modeswitch.c:527: warning: implicit declaration of function ‘libusb_get_device_address’
usb_modeswitch.c:528: warning: implicit declaration of function ‘libusb_get_bus_number’
usb_modeswitch.c:531: warning: implicit declaration of function ‘libusb_open’
usb_modeswitch.c:547: warning: passing argument 1 of ‘get_current_configuration’ from incompatible pointer type
usb_modeswitch.h:56: note: expected ‘struct libusb_device_handle *’ but argument is of type ‘struct libusb_device_handle *’
usb_modeswitch.c:553: warning: implicit declaration of function ‘libusb_get_device_descriptor’
usb_modeswitch.c:555: warning: implicit declaration of function ‘libusb_get_config_descriptor’
usb_modeswitch.c:557: error: dereferencing pointer to incomplete type
usb_modeswitch.c:561: warning: passing argument 1 of ‘get_interface_class’ from incompatible pointer type
usb_modeswitch.h:57: note: expected ‘struct libusb_config_descriptor *’ but argument is of type ‘struct libusb_config_descriptor *’
usb_modeswitch.c:562: warning: implicit declaration of function ‘libusb_free_config_descriptor’
usb_modeswitch.c:728: warning: passing argument 1 of ‘get_current_configuration’ from incompatible pointer type
usb_modeswitch.h:56: note: expected ‘struct libusb_device_handle *’ but argument is of type ‘struct libusb_device_handle *’
usb_modeswitch.c:746: warning: implicit declaration of function ‘libusb_close’
usb_modeswitch.c:421: warning: unused variable ‘descriptor’
usb_modeswitch.c: In function ‘deviceDescription’:
usb_modeswitch.c:807: error: storage size of ‘descriptor’ isn’t known
usb_modeswitch.c:815: warning: implicit declaration of function ‘libusb_get_string_descriptor_ascii’
usb_modeswitch.c:807: warning: unused variable ‘descriptor’
usb_modeswitch.c: In function ‘deviceInquire’:
usb_modeswitch.c:867: warning: implicit declaration of function ‘libusb_claim_interface’
usb_modeswitch.c:872: warning: implicit declaration of function ‘libusb_clear_halt’
usb_modeswitch.c:874: warning: passing argument 1 of ‘usb_bulk_io’ from incompatible pointer type
usb_modeswitch.c:64: note: expected ‘struct libusb_device_handle *’ but argument is of type ‘struct libusb_device_handle *’
usb_modeswitch.c:880: warning: passing argument 1 of ‘usb_bulk_io’ from incompatible pointer type
usb_modeswitch.c:64: note: expected ‘struct libusb_device_handle *’ but argument is of type ‘struct libusb_device_handle *’
usb_modeswitch.c:886: warning: passing argument 1 of ‘usb_bulk_io’ from incompatible pointer type
usb_modeswitch.c:64: note: expected ‘struct libusb_device_handle *’ but argument is of type ‘struct libusb_device_handle *’
usb_modeswitch.c:907: warning: implicit declaration of function ‘libusb_release_interface’
usb_modeswitch.c: In function ‘findMBIMConfig’:
usb_modeswitch.c:920: warning: implicit declaration of function ‘libusb_get_device_list’
usb_modeswitch.c:927: error: storage size of ‘descriptor’ isn’t known
usb_modeswitch.c:952: error: dereferencing pointer to incomplete type
usb_modeswitch.c:953: error: dereferencing pointer to incomplete type
usb_modeswitch.c:954: error: dereferencing pointer to incomplete type
usb_modeswitch.c:955: error: dereferencing pointer to incomplete type
usb_modeswitch.c:927: warning: unused variable ‘descriptor’
usb_modeswitch.c: In function ‘resetUSB’:
usb_modeswitch.c:979: warning: implicit declaration of function ‘libusb_reset_device’
usb_modeswitch.c: In function ‘switchConfiguration’:
usb_modeswitch.c:1076: warning: implicit declaration of function ‘libusb_set_configuration’
usb_modeswitch.c: In function ‘switchAltSetting’:
usb_modeswitch.c:1094: warning: implicit declaration of function ‘libusb_set_interface_alt_setting’
usb_modeswitch.c: In function ‘switchHuaweiMode’:
usb_modeswitch.c:1108: warning: implicit declaration of function ‘libusb_control_transfer’
usb_modeswitch.c:1108: error: ‘LIBUSB_REQUEST_TYPE_STANDARD’ undeclared (first use in this function)
usb_modeswitch.c:1108: error: ‘LIBUSB_RECIPIENT_DEVICE’ undeclared (first use in this function)
usb_modeswitch.c:1109: error: ‘LIBUSB_REQUEST_SET_FEATURE’ undeclared (first use in this function)
usb_modeswitch.c: In function ‘switchSierraMode’:
usb_modeswitch.c:1120: error: ‘LIBUSB_REQUEST_TYPE_VENDOR’ undeclared (first use in this function)
usb_modeswitch.c:1121: error: ‘LIBUSB_ERROR_PIPE’ undeclared (first use in this function)
usb_modeswitch.c: In function ‘switchKobilMode’:
usb_modeswitch.c:1157: error: ‘LIBUSB_REQUEST_TYPE_VENDOR’ undeclared (first use in this function)
usb_modeswitch.c:1157: error: ‘LIBUSB_RECIPIENT_DEVICE’ undeclared (first use in this function)
usb_modeswitch.c:1157: error: ‘LIBUSB_ENDPOINT_IN’ undeclared (first use in this function)
usb_modeswitch.c: In function ‘switchQuantaMode’:
usb_modeswitch.c:1179: error: ‘LIBUSB_REQUEST_TYPE_VENDOR’ undeclared (first use in this function)
usb_modeswitch.c:1179: error: ‘LIBUSB_RECIPIENT_DEVICE’ undeclared (first use in this function)
usb_modeswitch.c:1179: error: ‘LIBUSB_ENDPOINT_IN’ undeclared (first use in this function)
usb_modeswitch.c: In function ‘switchBlackberryMode’:
usb_modeswitch.c:1191: error: ‘LIBUSB_REQUEST_TYPE_VENDOR’ undeclared (first use in this function)
usb_modeswitch.c:1191: error: ‘LIBUSB_RECIPIENT_DEVICE’ undeclared (first use in this function)
usb_modeswitch.c:1191: error: ‘LIBUSB_ENDPOINT_IN’ undeclared (first use in this function)
usb_modeswitch.c: In function ‘switchPantechMode’:
usb_modeswitch.c:1209: error: ‘LIBUSB_REQUEST_TYPE_VENDOR’ undeclared (first use in this function)
usb_modeswitch.c:1209: error: ‘LIBUSB_RECIPIENT_DEVICE’ undeclared (first use in this function)
usb_modeswitch.c: In function ‘switchActionMode’:
usb_modeswitch.c:1234: error: ‘LIBUSB_REQUEST_TYPE_CLASS’ undeclared (first use in this function)
usb_modeswitch.c:1234: error: ‘LIBUSB_RECIPIENT_INTERFACE’ undeclared (first use in this function)
usb_modeswitch.c:1237: warning: implicit declaration of function ‘usb_interrupt_io’
usb_modeswitch.c: In function ‘switchSequansMode’:
usb_modeswitch.c:1285: error: ‘LIBUSB_REQUEST_TYPE_VENDOR’ undeclared (first use in this function)
usb_modeswitch.c:1285: error: ‘LIBUSB_RECIPIENT_DEVICE’ undeclared (first use in this function)
usb_modeswitch.c: In function ‘detachDriver’:
usb_modeswitch.c:1416: warning: implicit declaration of function ‘libusb_kernel_driver_active’
usb_modeswitch.c:1417: error: ‘LIBUSB_ERROR_NOT_SUPPORTED’ undeclared (first use in this function)
usb_modeswitch.c:1430: warning: implicit declaration of function ‘libusb_detach_kernel_driver’
usb_modeswitch.c: In function ‘sendMessage’:
usb_modeswitch.c:1459: error: ‘LIBUSB_ERROR_NO_DEVICE’ undeclared (first use in this function)
usb_modeswitch.c: In function ‘write_bulk’:
usb_modeswitch.c:1585: warning: passing argument 1 of ‘usb_bulk_io’ from incompatible pointer type
usb_modeswitch.c:64: note: expected ‘struct libusb_device_handle *’ but argument is of type ‘struct libusb_device_handle *’
usb_modeswitch.c:1589: error: ‘LIBUSB_ERROR_NO_DEVICE’ undeclared (first use in this function)
usb_modeswitch.c: In function ‘read_bulk’:
usb_modeswitch.c:1599: warning: passing argument 1 of ‘usb_bulk_io’ from incompatible pointer type
usb_modeswitch.c:64: note: expected ‘struct libusb_device_handle *’ but argument is of type ‘struct libusb_device_handle *’
usb_modeswitch.c:1603: error: ‘LIBUSB_ERROR_NO_DEVICE’ undeclared (first use in this function)
usb_modeswitch.c: In function ‘search_devices’:
usb_modeswitch.c:1655: error: storage size of ‘descriptor’ isn’t known
usb_modeswitch.c:1694: error: storage size of ‘descriptor’ isn’t known
usb_modeswitch.c:1699: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1694: warning: unused variable ‘descriptor’
usb_modeswitch.c:1731: warning: passing argument 1 of ‘get_current_configuration’ from incompatible pointer type
usb_modeswitch.h:56: note: expected ‘struct libusb_device_handle *’ but argument is of type ‘struct libusb_device_handle *’
usb_modeswitch.c:1655: warning: unused variable ‘descriptor’
usb_modeswitch.c: In function ‘find_first_bulk_output_endpoint’:
usb_modeswitch.c:1771: error: invalid use of undefined type ‘struct libusb_config_descriptor’
usb_modeswitch.c:1771: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1774: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1775: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1776: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1776: error: ‘LIBUSB_ENDPOINT_ADDRESS_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1776: error: ‘LIBUSB_TRANSFER_TYPE_BULK’ undeclared (first use in this function)
usb_modeswitch.c:1777: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1777: error: ‘LIBUSB_ENDPOINT_DIR_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1778: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function ‘find_first_bulk_input_endpoint’:
usb_modeswitch.c:1791: error: invalid use of undefined type ‘struct libusb_config_descriptor’
usb_modeswitch.c:1791: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1793: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1794: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1795: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1795: error: ‘LIBUSB_ENDPOINT_ADDRESS_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1795: error: ‘LIBUSB_TRANSFER_TYPE_BULK’ undeclared (first use in this function)
usb_modeswitch.c:1796: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1796: error: ‘LIBUSB_ENDPOINT_DIR_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1797: error: dereferencing pointer to incomplete type
usb_modeswitch.c: At top level:
usb_modeswitch.c:1804: error: conflicting types for ‘get_current_configuration’
usb_modeswitch.h:56: note: previous declaration of ‘get_current_configuration’ was here
usb_modeswitch.c: In function ‘get_current_configuration’:
usb_modeswitch.c:1807: error: ‘LIBUSB_REQUEST_TYPE_STANDARD’ undeclared (first use in this function)
usb_modeswitch.c:1807: error: ‘LIBUSB_RECIPIENT_DEVICE’ undeclared (first use in this function)
usb_modeswitch.c:1807: error: ‘LIBUSB_REQUEST_GET_CONFIGURATION’ undeclared (first use in this function)
usb_modeswitch.c: At top level:
usb_modeswitch.c:1822: warning: ‘struct libusb_config_descriptor’ declared inside parameter list
usb_modeswitch.c:1822: error: conflicting types for ‘get_interface_class’
usb_modeswitch.h:57: note: previous declaration of ‘get_interface_class’ was here
usb_modeswitch.c: In function ‘get_interface_class’:
usb_modeswitch.c:1825: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1827: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1828: error: dereferencing pointer to incomplete type
make: *** [usb_modeswitch] Error 1
A little searching and found that "libusb-devel" needs to be installed. Downloaded the "libusb-1.x" from "http://www.draisberghof.de/usb_modeswitch/#download" and did the below:

Code:
tar -xvf libusb-1.0.9
cd lib*
./configure
make install
Then again got back to usb_modeswitch, ran the same commands but again got the same error as above.

Please help!
 
Old 02-15-2014, 12:57 PM   #2
latawaz
LQ Newbie
 
Registered: Feb 2014
Distribution: Slackware 14.1 64-bit
Posts: 14
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Thumbs up

Figured it out. Sad part is that yum install ... doesn't work. Anyways, listing what I did here for posterity.

Instead of the above method, use rpm's.

Download rpms from the following links:
http://pkgs.repoforge.org/usb_modeswitch-data & http://pkgs.repoforge.org/usb_modeswitch

Now install tcl with
Code:
yum install tcl
Now install the downloaded rpms with
Code:
rpm -ivh usb_modeswitch-1.2.3-1.el6.rf.i686.rpm usb_modeswitch-data-20120120-1.el6.rf.noarch.rpm
Done!
 
  


Reply

Tags
usb_modswitch


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to switch a GPRS USB without usb_modeswitch? floppy_stuttgart Linux - Wireless Networking 1 01-18-2014 11:43 AM
usb_modeswitch NOKEY error: skoda Linux - Hardware 3 12-13-2013 02:02 PM
[SOLVED] usb_modeswitch with Huawei e220 toredo Linux - Software 7 07-23-2011 09:33 AM
Unable to install USB_ModeSwitch sudhirpradhan Linux - Newbie 11 07-03-2011 12:22 PM
Verizon/Nortel USB760 3G and USB_ModeSwitch tronayne Slackware 4 06-09-2010 03:05 AM


All times are GMT -5. The time now is 08:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration