Author Message

<  Device Information  ~  Errors when installing libusb-1.0.6 and usb-modeswitch-1.1.0

PostPosted: Sun Feb 28, 2010 9:53 pm Reply with quote
Posts: 7 Joined: Sun Feb 28, 2010 8:55 pm
:wink: Hi everyone. I'm a newbie when it comes to Linux and I have schizophrenia, and so I need everything explained in a very simple way to get the message across.

Don'y worry too much about the schizophrenia, I'm sure it won't matter too much.

I am trying to get usb-modeswitch to work under ubuntu 9.10 on a laptop, but am having error messages when installing, and so
USB-modeswitch is not currently working.

The messages:

When installing libusb-1.0.6, I get to the 'sudo make install' part, where you can see that there are error messages at the end of the output;

Code:
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
configure: WARNING: Libtool does not cope well with whitespace in `pwd`
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for inline... inline
checking whether gcc and cc understand -c and -o together... yes
checking operating system... Linux
checking for clock_gettime in -lrt... yes
checking sys/timerfd.h usability... yes
checking sys/timerfd.h presence... yes
checking for sys/timerfd.h... yes
checking whether TFD_NONBLOCK is declared... yes
checking whether to use timerfd for timing... yes
configure: creating ./config.status
config.status: creating libusb-1.0.pc
config.status: creating Makefile
config.status: creating libusb/Makefile
config.status: creating examples/Makefile
config.status: creating doc/Makefile
config.status: creating doc/doxygen.cfg
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
dan@dans:~/usb mode switch/libusb-1.0.6$ sudo make
make  all-recursive
make[1]: Entering directory `/home/dan/usb mode switch/libusb-1.0.6'
Making all in libusb
make[2]: Entering directory `/home/dan/usb mode switch/libusb-1.0.6/libusb'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/dan/usb mode switch/libusb-1.0.6/libusb'
Making all in doc
make[2]: Entering directory `/home/dan/usb mode switch/libusb-1.0.6/doc'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/dan/usb mode switch/libusb-1.0.6/doc'
make[2]: Entering directory `/home/dan/usb mode switch/libusb-1.0.6'
make[2]: Leaving directory `/home/dan/usb mode switch/libusb-1.0.6'
make[1]: Leaving directory `/home/dan/usb mode switch/libusb-1.0.6'
dan@dans:~/usb mode switch/libusb-1.0.6$ sudo make instal
make: *** No rule to make target `instal'. Stop.
dan@dans:~/usb mode switch/libusb-1.0.6$ sudo make install
Making install in libusb
make[1]: Entering directory `/home/dan/usb mode switch/libusb-1.0.6/libusb'
make[2]: Entering directory `/home/dan/usb mode switch/libusb-1.0.6/libusb'
test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib"
 /bin/bash ../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
/bin/bash: /home/dan/usb: No such file or directory
make[2]: *** [install-libLTLIBRARIES] Error 127
make[2]: Leaving directory `/home/dan/usb mode switch/libusb-1.0.6/libusb'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/dan/usb mode switch/libusb-1.0.6/libusb'
make: *** [install-recursive] Error 1



After following all the instructions and typing 'tclsh' then 'sudo make install' in the usb-modeswitch-1.1.0 directory, I get tons of error messages as you can see below!

Code:
gcc -Wall -l usb -o usb_modeswitch usb_modeswitch.c
usb_modeswitch.c:66:17: error: usb.h: No such file or directory
usb_modeswitch.c: In function ‘main’:
usb_modeswitch.c:343: warning: implicit declaration of function ‘usb_init’
usb_modeswitch.c:346: warning: implicit declaration of function ‘usb_set_debug’
usb_modeswitch.c:348: warning: implicit declaration of function ‘usb_find_busses’
usb_modeswitch.c:349: warning: implicit declaration of function ‘usb_find_devices’
usb_modeswitch.c:397: error: dereferencing pointer to incomplete type
usb_modeswitch.c:398: error: dereferencing pointer to incomplete type
usb_modeswitch.c:400: warning: implicit declaration of function ‘usb_open’
usb_modeswitch.c:400: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:407: error: dereferencing pointer to incomplete type
usb_modeswitch.c:409: error: dereferencing pointer to incomplete type
usb_modeswitch.c:411: error: dereferencing pointer to incomplete type
usb_modeswitch.c:561: warning: implicit declaration of function ‘usb_close’
usb_modeswitch.c: In function ‘deviceDescription’:
usb_modeswitch.c:576: error: dereferencing pointer to incomplete type
usb_modeswitch.c:577: warning: implicit declaration of function ‘usb_get_string_simple’
usb_modeswitch.c:577: error: dereferencing pointer to incomplete type
usb_modeswitch.c:586: error: dereferencing pointer to incomplete type
usb_modeswitch.c:587: error: dereferencing pointer to incomplete type
usb_modeswitch.c:596: error: dereferencing pointer to incomplete type
usb_modeswitch.c:597: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function ‘deviceInquire’:
usb_modeswitch.c:629: warning: implicit declaration of function ‘usb_claim_interface’
usb_modeswitch.c:634: warning: implicit declaration of function ‘usb_clear_halt’
usb_modeswitch.c:636: warning: implicit declaration of function ‘usb_bulk_write’
usb_modeswitch.c:642: warning: implicit declaration of function ‘usb_bulk_read’
usb_modeswitch.c:669: warning: implicit declaration of function ‘usb_release_interface’
usb_modeswitch.c: In function ‘resetUSB’:
usb_modeswitch.c:685: warning: implicit declaration of function ‘sleep’
usb_modeswitch.c:687: warning: implicit declaration of function ‘usb_reset’
usb_modeswitch.c: In function ‘switchConfiguration’:
usb_modeswitch.c:753: warning: implicit declaration of function ‘usb_set_configuration’
usb_modeswitch.c: In function ‘switchAltSetting’:
usb_modeswitch.c:769: warning: implicit declaration of function ‘usb_set_altinterface’
usb_modeswitch.c: In function ‘switchHuaweiMode’:
usb_modeswitch.c:786: warning: implicit declaration of function ‘usb_control_msg’
usb_modeswitch.c:786: error: ‘USB_TYPE_STANDARD’ undeclared (first use in this function)
usb_modeswitch.c:786: error: (Each undeclared identifier is reported only once
usb_modeswitch.c:786: error: for each function it appears in.)
usb_modeswitch.c:786: error: ‘USB_RECIP_DEVICE’ undeclared (first use in this function)
usb_modeswitch.c:786: error: ‘USB_REQ_SET_FEATURE’ undeclared (first use in this function)
usb_modeswitch.c: In function ‘switchSonyMode’:
usb_modeswitch.c:872: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c: In function ‘detachDriver’:
usb_modeswitch.c:909: warning: implicit declaration of function ‘usb_get_driver_np’
usb_modeswitch.c:926: warning: implicit declaration of function ‘usb_detach_kernel_driver_np’
usb_modeswitch.c: In function ‘checkSuccess’:
usb_modeswitch.c:982: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:987: error: dereferencing pointer to incomplete type
usb_modeswitch.c:987: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function ‘search_devices’:
usb_modeswitch.c:1093: warning: implicit declaration of function ‘usb_get_busses’
usb_modeswitch.c:1093: warning: assignment makes pointer from integer without a cast
usb_modeswitch.c:1093: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1095: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1095: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1097: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1097: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1098: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1119: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1126: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1126: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1128: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1138: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1142: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1144: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1146: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1147: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1153: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1153: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function ‘find_first_bulk_output_endpoint’:
usb_modeswitch.c:1176: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1179: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1180: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1181: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1181: error: ‘USB_ENDPOINT_TYPE_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1181: error: ‘USB_ENDPOINT_TYPE_BULK’ undeclared (first use in this function)
usb_modeswitch.c:1182: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1182: error: ‘USB_ENDPOINT_DIR_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1183: error: dereferencing pointer to incomplete type
usb_modeswitch.c: In function ‘find_first_bulk_input_endpoint’:
usb_modeswitch.c:1194: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1197: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1198: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1199: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1199: error: ‘USB_ENDPOINT_TYPE_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1199: error: ‘USB_ENDPOINT_TYPE_BULK’ undeclared (first use in this function)
usb_modeswitch.c:1200: error: dereferencing pointer to incomplete type
usb_modeswitch.c:1200: error: ‘USB_ENDPOINT_DIR_MASK’ undeclared (first use in this function)
usb_modeswitch.c:1201: error: dereferencing pointer to incomplete type
make: *** [usb_modeswitch] Error 1



Please help!

Seecheckstuff (a boring name I know, but a name for now...) :)


Offline
PostPosted: Fri Mar 05, 2010 6:08 pm Reply with quote
Posts: 8 Joined: Thu Mar 04, 2010 3:33 pm
For seecheckstuff:
error is
Code:
/bin/bash: /home/dan/usb: No such file or directory

are you sure that this dir exists at the moment you launch 'sudo make install' command?


For st0ne:
you need to install usb_modeswitch-1.1.0 package before installing usb_modeswitch data package (that is only an update of config files and rules).


Offline
PostPosted: Sat Mar 06, 2010 8:30 pm Reply with quote
Posts: 7 Joined: Sun Feb 28, 2010 8:55 pm
Thankyou Maumez, I appreciate it, but now the errors at the end of the libusb output has changed to

Code:
libtool: install: ranlib /usr/local/lib/libusb-1.0.a 
/home/dan/usb: /home/dan/usb: is a directory
make[2]: *** [install-libLTLIBRARIES] Error 126 
make[2]: Leaving directory `/home/dan/usb mode switch/libusb-1.0.6/libusb' 
make[1]: *** [install-am] Error 2 
make[1]: Leaving directory `/home/dan/usb mode switch/libusb-1.0.6/libusb' 
make: *** [install-recursive] Error 1


As you can see, the second line reads as 'is a directory' instead of 'no such file or directory'. On the third line, there is an error 126 instead of an error 127. Maybe there is more wrong that I just haven't seen.

The install for usb-switch is still not working... any more ideas?

Thanks again. 8)


Offline
PostPosted: Sun Mar 07, 2010 11:41 am Reply with quote
Site Admin Posts: 6430 Joined: Sat Nov 03, 2007 12:30 am
seecheckstuff, I generally advise to use folder names without blanks when compiling. Otherwise you'll run into all kinds of ambiguities.

Try to rename that "usb mode switch" folder to something like "modeswitch" or similar. Make sure that the full path name to the libusb source does not contain any blanks.


Offline
PostPosted: Sun Mar 07, 2010 5:20 pm Reply with quote
Posts: 7 Joined: Sun Feb 28, 2010 8:55 pm
Josh,that's got to be it. I'll try it right now... :lol:


Offline
PostPosted: Sun Mar 07, 2010 6:13 pm Reply with quote
Posts: 7 Joined: Sun Feb 28, 2010 8:55 pm
... and it's not working yet, though some progress has been made.:)

I have taken away all the spaces in the file names and now libusb compiles without errors.

However, I am still getting the same error messages from before when installing usb_modeswitch. I won't print the errors as they are the same as I've posted in my first post.

It looks like this guy (felix) has the same errors as me;
viewtopic.php?t=121

The reply suggested that felix's usb-modeswitch couldn't find libusb, but my libusb looks fine. :?

Maybe he found a solution, but I don't really understand the rest of the answer to his post - this was suggested;

CFLAGS += -I/home/THF/Download/libusb/libusb -L/home/THF/Download/libusb/libusb/.libs
LIBS += -lusb

I typed in CFLAGS and the rest of it, and it doesn't seem to be a command.

I'm itchin to get online!


Offline
PostPosted: Mon Mar 08, 2010 6:22 pm Reply with quote
Site Admin Posts: 6430 Joined: Sat Nov 03, 2007 12:30 am
To be able to use your freshly compiled libusb, you have to install it first. Did you do that?

If not, run a "make install" after the successful "make" in the libusb source directory. You need to do that as root or with the help of "sudo" because admin rights are necessary for this.

Also make sure you have a "usb.h" in /usr/local/include. Don't use the "usb.h" from /usr/include/linux.
If it is in the right place and compiling still fails, then open the "Makefile" of usb_modeswitch in an editor and add this to the end of the
"CFLAGS += ..." line (it's not a command, it's a variable):
Code:
-I /usr/local/include -L /usr/local/lib
This forces the compiler to look there for the include and library files.



Offline
PostPosted: Thu Mar 11, 2010 1:11 am Reply with quote
Posts: 7 Joined: Sun Feb 28, 2010 8:55 pm
Thankyou for the input Josh. I looked in the file system and there is no "usb.h" in "/usr/local/include". In fact, the only thing there is the directory "libusb-1.0" And the only thing in "libusb-1.0" is a file called "libusb.h". Also, there is no /usr/include/linux directory.

How do you get usb.h into the directory?

As I said, I think I have correctly installed libusb.

I have installed it many times now, trying to solve the problem. Do you think that has something to do with it?

Again, thanks. :)


Offline
PostPosted: Thu Mar 11, 2010 8:37 am Reply with quote
Site Admin Posts: 6430 Joined: Sat Nov 03, 2007 12:30 am
Oioioioi - my bad! I should read my own installation hints :roll:

Your installation is fine, but a component is missing; the "libusb-compat-0.1" package. It is not part of the new libusb package and has to be downloaded separately. You need it for usb_modeswitch.

See the link to "libusb-compat-0.1 compatibility layer" on the libusb home page.


Offline
PostPosted: Wed Mar 17, 2010 4:22 pm Reply with quote
Posts: 1 Joined: Wed Mar 17, 2010 4:17 pm
Hi, I've encountered the same problem on CentOS and I solved it by installing the libusb-devel package, which holds header files for libusb. So I think, you need to install header files for libusb for your distro.

Best wishes!


Offline
PostPosted: Sun Mar 21, 2010 3:58 pm Reply with quote
Posts: 7 Joined: Sun Feb 28, 2010 8:55 pm
Thanks Guys, I did what Josh said in his last post, regarding the libusb-compat-0.1 compatibility layer, and the installation went fine. The only problem is that although network manager picked up the modem initially, it has hasn't been able to pick it up for the last seven days. At least I think that network manager is the problem after reading the information page.

So anyway, at the moment I'm trying to figure out wvdial, and failing that I will try the Sakis3G tool. It's quite difficult since the laptop isn't connected to the internet (I'm downloading onto a windows machine) But I will prevail! :wink:

I will post once I get it working.


Offline
PostPosted: Sun Mar 21, 2010 4:22 pm Reply with quote
Site Admin Posts: 6430 Joined: Sat Nov 03, 2007 12:30 am
If your modem provides more than one ttyUSB port (most do), it's likely that NetworkManager tries to use a wrong one. As there is no way to set the port manually in NM, it's probably better to use a connection tool that has this ability. Like wvdial.


Offline
PostPosted: Wed Mar 24, 2010 10:14 pm Reply with quote
Posts: 7 Joined: Sun Feb 28, 2010 8:55 pm
I will install wvdial as you suggest. Just out of interest, what is a "ttyUSB port" on the modem? I know that the modem only has one USB connection.

Thanks for all your help.

Dan.


Offline
PostPosted: Thu Mar 25, 2010 9:53 pm Reply with quote
Site Admin Posts: 6430 Joined: Sat Nov 03, 2007 12:30 am
The modems are usually built to provide several functions at the same time. These functions can be accessed as separate devices built into one case and sharing the same USB cable.
Every operating system has to ask an USB device about the functions it provides, and in the case of the modems there are often two drivers needed for one device to make use of all features ("usb-storage" for SD card slots and "option" for the serial ports).

The old analogue modems had just one line (or port) for connection. Once the connection worked there was no way to configure or query the modem. This is what makes the additional serial ports in today's wireless modems useful. You have your connection running on one port (which is optimized for high data throughput) and can query the modem on annother port (for instance about the current net quality or transmission mode) or even send an SMS.

Fortunately, you as the user (and even I as the application programmer) don't have to care how the single USB cable manages to separate the traffic between the ports. You just need the device files under the "/dev" directory where you can directly use the ttyUSBx entries to write on or to read from. In fact, you could even sent modem commands with the "echo" command (# echo "ATZ" >/dev/ttyUSB0).



Offline

Display posts from previous:  Sort by:

All times are UTC+02:00
Page 1 of 1
14 posts
Users browsing this forum: No registered users and 2 guests
Search for:
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum