libusb-dev package instalation problem
Hi
I'm running PCLinuxOS release 2008 (PCLinuxOS Gnome) for i586
Kernel 2.6.22.15.tex3 on an i686 /\l on an old laptop Compaq Evo N1050v
I was trying to make install usb-modeswitch-1.2.3 and received a lot of errors:
[root@localhost usb-modeswitch-1.2.3]# make install
gcc -o usb_modeswitch usb_modeswitch.c -Wall -l usb
usb_modeswitch.c:58:17: error: usb.h: No such file or directory
In file included from usb_modeswitch.c:59:
usb_modeswitch.h:53: warning: ?struct usb_dev_handle? declared inside parameter list
usb_modeswitch.h:53: warning: its scope is only this definition or declaration, which is probably not what you want
usb_modeswitch.c: In function ?main?:
usb_modeswitch.c:416: warning: implicit declaration of function ?usb_init?
usb_modeswitch.c:419: warning: implicit declaration of function ?usb_set_debug?
usb_modeswitch.c:421: warning: implicit declaration of function ?usb_find_busses?
usb_modeswitch.c:422: warning: implicit declaration of function ?usb_find_devices?
usb_modeswitch.c:448: error: dereferencing pointer to incomplete type
usb_modeswitch.c:449: error: dereferencing pointer to incomplete type
usb_modeswitch.c:452: warning: implicit declaration of function ?usb_open?
usb_modeswitch.c:452: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:465: warning: passing argument 1 of ?get_current_configuration? from incompatible pointer type
usb_modeswitch.c:472: error: dereferencing pointer to incomplete type
usb_modeswitch.c:489: error: dereferencing pointer to incomplete type
usb_modeswitch.c:612: warning: passing argument 1 of ?get_current_configuration? from incompatible pointer type
usb_modeswitch.c:630: warning: implicit declaration of function ?usb_close?
... and the list goes on. I found the solution somewhere else on this forum that simply stated that this error indicates one requires the libusb-dev (developement package). I searched for it and downloaded libusb-1.0.8 (I don't know whether this is the correct package because I simply cannot find "libusb-dev" anywhere and don't know whether there is a difference between "libusb" and "libusb-dev" but as I said, cannot find the dev package anywhere.
Nevertheless, I proceeded to install the libusb-1.0.8 package and all appeared to have gone down fine:
libusb-1.0.8
[root@localhost libusb-1.0.8]# make install
Making install in libusb
make[1]: Entering directory `/home/isja/tmp/libusb-1.0.8/libusb'
make[2]: Entering directory `/home/isja/tmp/libusb-1.0.8/libusb'
test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib"
/bin/sh ../libtool --mode=install /usr/bin/install -c libusb-1.0.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libusb-1.0.so.0.0.0 /usr/local/lib/libusb-1.0.so.0.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libusb-1.0.so.0.0.0 libusb-1.0.so.0 || { rm -f libusb-1.0.so.0 && ln -s libusb-1.0.so.0.0.0 libusb-1.0.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libusb-1.0.so.0.0.0 libusb-1.0.so || { rm -f libusb-1.0.so && ln -s libusb-1.0.so.0.0.0 libusb-1.0.so; }; })
libtool: install: /usr/bin/install -c .libs/libusb-1.0.lai /usr/local/lib/libusb-1.0.la
libtool: install: /usr/bin/install -c .libs/libusb-1.0.a /usr/local/lib/libusb-1.0.a
libtool: install: chmod 644 /usr/local/lib/libusb-1.0.a
libtool: install: ranlib /usr/local/lib/libusb-1.0.a
libtool: finish: PATH="/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/usr/games:/home/isja/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
test -z "/usr/local/include/libusb-1.0" || /bin/mkdir -p "/usr/local/include/libusb-1.0"
/usr/bin/install -c -m 644 libusb.h '/usr/local/include/libusb-1.0'
make[2]: Leaving directory `/home/isja/tmp/libusb-1.0.8/libusb'
make[1]: Leaving directory `/home/isja/tmp/libusb-1.0.8/libusb'
Making install in doc
make[1]: Entering directory `/home/isja/tmp/libusb-1.0.8/doc'
make[2]: Entering directory `/home/isja/tmp/libusb-1.0.8/doc'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/isja/tmp/libusb-1.0.8/doc'
make[1]: Leaving directory `/home/isja/tmp/libusb-1.0.8/doc'
make[1]: Entering directory `/home/isja/tmp/libusb-1.0.8'
make[2]: Entering directory `/home/isja/tmp/libusb-1.0.8'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/lib/pkgconfig" || /bin/mkdir -p "/usr/local/lib/pkgconfig"
/usr/bin/install -c -m 644 libusb-1.0.pc '/usr/local/lib/pkgconfig'
make[2]: Leaving directory `/home/isja/tmp/libusb-1.0.8'
make[1]: Leaving directory `/home/isja/tmp/libusb-1.0.8'
[root@localhost libusb-1.0.8]#
After this, I tried installing the usb-modeswitch-1.2.3 again with the same error as above.
I unfortunately don't understand the concept of libraries at all and the more I read about it, the less I understand it. It seems as though libusb was successfully deployed however I don't know what to do from here? linking the library to executables (there are no executables in usb-modeswitch that I can see) and the concept of static and shared libraries is just as confusing.
All I really need is for my Huawei dongle not to act as a flash drive. I managed to install usb-modeswitch on a Apacer laptop before which was pretty straight forward and none of these library and dev package issues and works fine there.
Please help!
I'm running PCLinuxOS release 2008 (PCLinuxOS Gnome) for i586
Kernel 2.6.22.15.tex3 on an i686 /\l on an old laptop Compaq Evo N1050v
I was trying to make install usb-modeswitch-1.2.3 and received a lot of errors:
[root@localhost usb-modeswitch-1.2.3]# make install
gcc -o usb_modeswitch usb_modeswitch.c -Wall -l usb
usb_modeswitch.c:58:17: error: usb.h: No such file or directory
In file included from usb_modeswitch.c:59:
usb_modeswitch.h:53: warning: ?struct usb_dev_handle? declared inside parameter list
usb_modeswitch.h:53: warning: its scope is only this definition or declaration, which is probably not what you want
usb_modeswitch.c: In function ?main?:
usb_modeswitch.c:416: warning: implicit declaration of function ?usb_init?
usb_modeswitch.c:419: warning: implicit declaration of function ?usb_set_debug?
usb_modeswitch.c:421: warning: implicit declaration of function ?usb_find_busses?
usb_modeswitch.c:422: warning: implicit declaration of function ?usb_find_devices?
usb_modeswitch.c:448: error: dereferencing pointer to incomplete type
usb_modeswitch.c:449: error: dereferencing pointer to incomplete type
usb_modeswitch.c:452: warning: implicit declaration of function ?usb_open?
usb_modeswitch.c:452: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:465: warning: passing argument 1 of ?get_current_configuration? from incompatible pointer type
usb_modeswitch.c:472: error: dereferencing pointer to incomplete type
usb_modeswitch.c:489: error: dereferencing pointer to incomplete type
usb_modeswitch.c:612: warning: passing argument 1 of ?get_current_configuration? from incompatible pointer type
usb_modeswitch.c:630: warning: implicit declaration of function ?usb_close?
... and the list goes on. I found the solution somewhere else on this forum that simply stated that this error indicates one requires the libusb-dev (developement package). I searched for it and downloaded libusb-1.0.8 (I don't know whether this is the correct package because I simply cannot find "libusb-dev" anywhere and don't know whether there is a difference between "libusb" and "libusb-dev" but as I said, cannot find the dev package anywhere.
Nevertheless, I proceeded to install the libusb-1.0.8 package and all appeared to have gone down fine:
libusb-1.0.8
[root@localhost libusb-1.0.8]# make install
Making install in libusb
make[1]: Entering directory `/home/isja/tmp/libusb-1.0.8/libusb'
make[2]: Entering directory `/home/isja/tmp/libusb-1.0.8/libusb'
test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib"
/bin/sh ../libtool --mode=install /usr/bin/install -c libusb-1.0.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libusb-1.0.so.0.0.0 /usr/local/lib/libusb-1.0.so.0.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libusb-1.0.so.0.0.0 libusb-1.0.so.0 || { rm -f libusb-1.0.so.0 && ln -s libusb-1.0.so.0.0.0 libusb-1.0.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libusb-1.0.so.0.0.0 libusb-1.0.so || { rm -f libusb-1.0.so && ln -s libusb-1.0.so.0.0.0 libusb-1.0.so; }; })
libtool: install: /usr/bin/install -c .libs/libusb-1.0.lai /usr/local/lib/libusb-1.0.la
libtool: install: /usr/bin/install -c .libs/libusb-1.0.a /usr/local/lib/libusb-1.0.a
libtool: install: chmod 644 /usr/local/lib/libusb-1.0.a
libtool: install: ranlib /usr/local/lib/libusb-1.0.a
libtool: finish: PATH="/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/usr/games:/home/isja/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
test -z "/usr/local/include/libusb-1.0" || /bin/mkdir -p "/usr/local/include/libusb-1.0"
/usr/bin/install -c -m 644 libusb.h '/usr/local/include/libusb-1.0'
make[2]: Leaving directory `/home/isja/tmp/libusb-1.0.8/libusb'
make[1]: Leaving directory `/home/isja/tmp/libusb-1.0.8/libusb'
Making install in doc
make[1]: Entering directory `/home/isja/tmp/libusb-1.0.8/doc'
make[2]: Entering directory `/home/isja/tmp/libusb-1.0.8/doc'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/isja/tmp/libusb-1.0.8/doc'
make[1]: Leaving directory `/home/isja/tmp/libusb-1.0.8/doc'
make[1]: Entering directory `/home/isja/tmp/libusb-1.0.8'
make[2]: Entering directory `/home/isja/tmp/libusb-1.0.8'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/lib/pkgconfig" || /bin/mkdir -p "/usr/local/lib/pkgconfig"
/usr/bin/install -c -m 644 libusb-1.0.pc '/usr/local/lib/pkgconfig'
make[2]: Leaving directory `/home/isja/tmp/libusb-1.0.8'
make[1]: Leaving directory `/home/isja/tmp/libusb-1.0.8'
[root@localhost libusb-1.0.8]#
After this, I tried installing the usb-modeswitch-1.2.3 again with the same error as above.
I unfortunately don't understand the concept of libraries at all and the more I read about it, the less I understand it. It seems as though libusb was successfully deployed however I don't know what to do from here? linking the library to executables (there are no executables in usb-modeswitch that I can see) and the concept of static and shared libraries is just as confusing.
All I really need is for my Huawei dongle not to act as a flash drive. I managed to install usb-modeswitch on a Apacer laptop before which was pretty straight forward and none of these library and dev package issues and works fine there.
Please help!
I recommend installing libusb (the legacy version) from source.
I put it on my web server for convenience, here is the package.
First, remove your distribution's "libusb" package.
Then run "./configure --prefix=/usr" in the unpacked source directory. If no errors pop up, run "make" and "make install".
Should be no problem to compile it, there are not many dependencies. I find it still sufficient for simple tasks like mode switching.
Greetings to Windhoek, and may you get plenty of rain (probably a bit less than last year) !
I put it on my web server for convenience, here is the package.
First, remove your distribution's "libusb" package.
Then run "./configure --prefix=/usr" in the unpacked source directory. If no errors pop up, run "make" and "make install".
Should be no problem to compile it, there are not many dependencies. I find it still sufficient for simple tasks like mode switching.
Greetings to Windhoek, and may you get plenty of rain (probably a bit less than last year) !
removing libusb package
When removing the libusb0.1_4 package I get an output showing a whole page of other packages that will be removed. Also a warning that I'm about to do something potentially harmful.
Are you sure I should be doing this?
usb.h file
Hi Josh
I promise you're going to get 'gatvol' of me.
Where do I find the usb.h file, it's not among the libusb source files nor is it among the usb-modeswitch-1.2.3 source files.
I've searched the entire file system and found 4, each one in a different location:
/usr/include/linux;
/usr/src/linux-2.6.22.15.tex3/include/linux;
/usr/src/ndiswrapper-1.48-2pclos2007; and
/var/lib/dkms/ndiswrapper/1.48-2pclos/build
I copied each one to the /usr/include location that you have specified, each time overwriting the previous file and each time trying to make from usb-modeswitch-1.2.3
I kept on getting a long list of errors. From the first location:
In file included from /usr/include/usb.h:4, from usb_modeswitch.c:58
/usr/include/linux/mod_devicetable.h:174: error expected specifier-qualifier-list before '__u8' etc.
From the second location the same error as above.
From the third and forth location the error list is so long that I can't even scroll back to the start.
I promise you're going to get 'gatvol' of me.
Where do I find the usb.h file, it's not among the libusb source files nor is it among the usb-modeswitch-1.2.3 source files.
I've searched the entire file system and found 4, each one in a different location:
/usr/include/linux;
/usr/src/linux-2.6.22.15.tex3/include/linux;
/usr/src/ndiswrapper-1.48-2pclos2007; and
/var/lib/dkms/ndiswrapper/1.48-2pclos/build
I copied each one to the /usr/include location that you have specified, each time overwriting the previous file and each time trying to make from usb-modeswitch-1.2.3
I kept on getting a long list of errors. From the first location:
In file included from /usr/include/usb.h:4, from usb_modeswitch.c:58
/usr/include/linux/mod_devicetable.h:174: error expected specifier-qualifier-list before '__u8' etc.
From the second location the same error as above.
From the third and forth location the error list is so long that I can't even scroll back to the start.
I assumed you had run the "./configure" and "make" commands in the libusb source folder already ...
There is a file "usb.h.in" that will be slightly adapted during the configuration process and will result in "usb.h". Don't worry, as long as you don't run "make install", your system stays unchanged.
There is a file "usb.h.in" that will be slightly adapted during the configuration process and will result in "usb.h". Don't worry, as long as you don't run "make install", your system stays unchanged.
gcc compiler
Hi
./configure gives me the error:
error: C++ preprocessor "/lib/cpp" fails sanity check
See 'configure.log' for more details
I want to download gcc-4.5.1 but there's a warning not to upgrade if the kernel and native modules were compiled with a version prior to 4.5.1.
How do I know what version kernel or any other 3rd party modules were compiled with and should I recompile them?
Isn't there rather an earlier version of usb-modeswith that wouldn't require all these other package dependant updates?
./configure gives me the error:
error: C++ preprocessor "/lib/cpp" fails sanity check
See 'configure.log' for more details
I want to download gcc-4.5.1 but there's a warning not to upgrade if the kernel and native modules were compiled with a version prior to 4.5.1.
How do I know what version kernel or any other 3rd party modules were compiled with and should I recompile them?
Isn't there rather an earlier version of usb-modeswith that wouldn't require all these other package dependant updates?
I have no idea what causes the error on your system. Libusb itself is a very proven and, well, dated project. usb_modeswitch is based on version 0.1.12 since the very first release.
I suspect you would have to update your system to get rid of this compiler trouble.
To work around your problem, here are the respective files, taken from my Mandriva machine. Just copy them to /usr/include. The second file is not used directly by the usb_modeswitch source, so it's just a safety measure.
http://www.draisberghof.de/usb_modeswitch/usb.h
http://www.draisberghof.de/usb_modeswitch/usbpp.h
I suspect you would have to update your system to get rid of this compiler trouble.
To work around your problem, here are the respective files, taken from my Mandriva machine. Just copy them to /usr/include. The second file is not used directly by the usb_modeswitch source, so it's just a safety measure.
http://www.draisberghof.de/usb_modeswitch/usb.h
http://www.draisberghof.de/usb_modeswitch/usbpp.h
Hmm, maybe there is no "/usr/lib/libusb.so" file. If that is the case, try running "ldconfig", this should create a symbolic link to "/usr/lib/libusb0.1.4" or however the file is called on your system.
This is a standard procedure BTW when it comes to dynamic libraries in Linux. The real file has a name which includes the exact version information, and there are more common file names like "libusb.0" or "libusb" which are just pointers to the real file. That way, programs may request the "common" library or the specific version of it - they will effectively work with the same file.
So, if you don't find a "libusb.so" file even after running "ldconfig", you might have to add the symbolic link yourself. You know how to work with the "ln" command. right?
This is a standard procedure BTW when it comes to dynamic libraries in Linux. The real file has a name which includes the exact version information, and there are more common file names like "libusb.0" or "libusb" which are just pointers to the real file. That way, programs may request the "common" library or the specific version of it - they will effectively work with the same file.
So, if you don't find a "libusb.so" file even after running "ldconfig", you might have to add the symbolic link yourself. You know how to work with the "ln" command. right?
Hi Josh
Installed Puppy Linux on the machine (Lupex). Too may missing files and broken packages etc and also KDE4 too resource hungry. With Puppy I got a lot further, however, the device seems to disappear just after switching. I made some updates in the usb_modeswitch.conf file (DefaultVendor/Product & MessageEndpoint / Content) with info that I found elsewhere in the forum and tried switching manually, see below:
Installed Puppy Linux on the machine (Lupex). Too may missing files and broken packages etc and also KDE4 too resource hungry. With Puppy I got a lot further, however, the device seems to disappear just after switching. I made some updates in the usb_modeswitch.conf file (DefaultVendor/Product & MessageEndpoint / Content) with info that I found elsewhere in the forum and tried switching manually, see below:
sh-4.1# usb_modeswitch -v 0x12d1 -p 0x1001 -HW -s 20 -c /etc/usb_modeswitch.conf
Reading config file: /etc/usb_modeswitch.conf
* usb_modeswitch: handle USB devices with multiple modes
* Version 1.1.9 (C) Josua Dietze 2011
* Based on libusb0 (0.1.12 and above)
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x12d1
DefaultProduct= 0x1001
TargetVendor= not set
TargetProduct= not set
TargetClass= not set
TargetProductList=""
DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
GCTMode=0
KobilMode=0
SequansMode=0
MobileActionMode=0
CiscoMode=0
MessageEndpoint=0x01
MessageContent="55534243000000000000000000000011060000000000000000000000000000"
NeedResponse=0
ResponseEndpoint= not set
Interface=0x00
InquireDevice enabled (default)
Success check enabled, max. wait time 20 seconds
System integration mode disabled
usb_set_debug: Setting debugging level to 15 (on)
usb_os_find_busses: Found 001
usb_os_find_devices: Couldn't open /dev/bus/usb/001/011
usb_os_find_devices: Found 007 on 001
error obtaining child information: Inappropriate ioctl for device
Note: target parameter missing; success check limited
Looking for default devices ...
searching devices, found USB ID 12d1:1001
found matching vendor ID
found matching product ID
adding device
Found devices in default mode, class or configuration (1)
Accessing device 007 on bus 001 ...
Getting the current device configuration ...
OK, got current device configuration (1)
Using endpoints 0x01 (out) and 0x82 (in)
Not a storage device, skipping SCSI inquiry
USB description data (for identification)
-------------------------
Manufacturer: HUAWEI Technology
Product: HUAWEI Mobile
Serial No.: not provided
-------------------------
Looking for active driver ...
OK, driver found ("option")
OK, driver "option" detached
Setting up communication with interface 0
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
OK, message successfully sent
Resetting response endpoint 0x82
USB error: could not clear/halt ep 130: Timer expired
Could not reset endpoint (probably harmless): -62
Resetting message endpoint 0x01
USB error: could not clear/halt ep 1: No such device
Could not reset endpoint (probably harmless): -19
USB error: could not release intf 0: No such device
Device is gone, skipping any further commands
Checking for mode switch (max. 20 times, once per second) ...
(For a better success check provide target IDs or class)
Original device vanished after switching
Mode switch most likely succeeded. Bye.
sh-4.1#
Uhm, no.
This means that your modem was switched automatically already. Don't switch it again.
usb_modeswitch is included in Puppy (and is working fine, AFAIK); you should not have to do anything but plugging your modem in.
Code: Select all
OK, driver found ("option")
OK, driver "option" detachedusb_modeswitch is included in Puppy (and is working fine, AFAIK); you should not have to do anything but plugging your modem in.
Lucid Puppy internet connection problem
Hi
Thank for that last bit of obvious advice. Strange thing now is that I'm connected and Active interfaces show: ppp0 Rx:0.0KB (Month:0MB) Tx:2.0KB (Month:0MB). When I click on browse I seem to need to download a browser first and when I click on any of the listed browsers, I get a message: "ERROR: Can't download. Please connect to the Internet". Is there something disjointed in Puppy?
Thank for that last bit of obvious advice. Strange thing now is that I'm connected and Active interfaces show: ppp0 Rx:0.0KB (Month:0MB) Tx:2.0KB (Month:0MB). When I click on browse I seem to need to download a browser first and when I click on any of the listed browsers, I get a message: "ERROR: Can't download. Please connect to the Internet". Is there something disjointed in Puppy?
Re: Lucid Puppy internet connection problem
If I were you I would run the usual tests. Check if you have a default route via ppp0 when connected ("route"). Then check if you have a working nameserver ("ping www.ripe.net"). If not, check if at least the IP connection works ("ping 193.0.6.139").Kees74 wrote:Is there something disjointed in Puppy?
These are very generic steps; I can't give more detailed advice regarding Puppy.