Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile on ubuntu 13.10 #3

Closed
tetherit opened this issue Jan 8, 2014 · 6 comments
Closed

Cannot compile on ubuntu 13.10 #3

tetherit opened this issue Jan 8, 2014 · 6 comments
Assignees
Labels

Comments

@tetherit
Copy link

tetherit commented Jan 8, 2014

I have the libusb-dev package installed:

ii  libusb-0.1-4:i386                   2:0.1.12-23.2ubuntu1             i386         userspace USB programming library
ii  libusb-1.0-0:i386                   2:1.0.16-3                       i386         userspace USB programming library
ii  libusb-1.0-0-dev:i386               2:1.0.16-3                       i386         userspace USB programming library development files
ii  libusb-1.0-doc                      2:1.0.16-3                       all          documentation for userspace USB programming
ii  libusb-dev                          2:0.1.12-23.2ubuntu1             i386         userspace USB programming library development files

However when I try to compile, I get this:

# ./compile
Base directory:  /data/sakis3g-source.
Source files:    All found.
Device database: Found and transformed.
/tmp/cc6y3QfZ.o: In function `main':
usb_modeswitch.c:(.text+0x1835): undefined reference to `usb_init'
usb_modeswitch.c:(.text+0x184c): undefined reference to `usb_set_debug'
usb_modeswitch.c:(.text+0x1851): undefined reference to `usb_find_busses'
usb_modeswitch.c:(.text+0x1856): undefined reference to `usb_find_devices'
usb_modeswitch.c:(.text+0x1b4f): undefined reference to `usb_open'
usb_modeswitch.c:(.text+0x245c): undefined reference to `usb_close'
usb_modeswitch.c:(.text+0x2483): undefined reference to `usb_close'
usb_modeswitch.c:(.text+0x269a): undefined reference to `usb_close'
/tmp/cc6y3QfZ.o: In function `deviceDescription':
usb_modeswitch.c:(.text+0x2740): undefined reference to `usb_get_string_simple'
usb_modeswitch.c:(.text+0x280d): undefined reference to `usb_get_string_simple'
usb_modeswitch.c:(.text+0x28da): undefined reference to `usb_get_string_simple'
/tmp/cc6y3QfZ.o: In function `deviceInquire':
usb_modeswitch.c:(.text+0x2a6d): undefined reference to `usb_claim_interface'
usb_modeswitch.c:(.text+0x2abf): undefined reference to `usb_clear_halt'
usb_modeswitch.c:(.text+0x2aed): undefined reference to `usb_bulk_write'
usb_modeswitch.c:(.text+0x2b55): undefined reference to `usb_bulk_read'
usb_modeswitch.c:(.text+0x2bbd): undefined reference to `usb_bulk_read'
usb_modeswitch.c:(.text+0x2cbf): undefined reference to `usb_clear_halt'
usb_modeswitch.c:(.text+0x2cd6): undefined reference to `usb_release_interface'
/tmp/cc6y3QfZ.o: In function `findMBIMConfig':
usb_modeswitch.c:(.text+0x2d40): undefined reference to `usb_get_busses'
/tmp/cc6y3QfZ.o: In function `resetUSB':
usb_modeswitch.c:(.text+0x2f77): undefined reference to `usb_reset'
/tmp/cc6y3QfZ.o: In function `switchSendMessage':
usb_modeswitch.c:(.text+0x30b4): undefined reference to `usb_claim_interface'
usb_modeswitch.c:(.text+0x3106): undefined reference to `usb_clear_halt'
usb_modeswitch.c:(.text+0x32b2): undefined reference to `usb_clear_halt'
usb_modeswitch.c:(.text+0x3324): undefined reference to `usb_clear_halt'
usb_modeswitch.c:(.text+0x33bd): undefined reference to `usb_release_interface'
usb_modeswitch.c:(.text+0x340c): undefined reference to `usb_close'
/tmp/cc6y3QfZ.o: In function `switchConfiguration':
usb_modeswitch.c:(.text+0x34a4): undefined reference to `usb_set_configuration'
/tmp/cc6y3QfZ.o: In function `switchAltSetting':
usb_modeswitch.c:(.text+0x3569): undefined reference to `usb_claim_interface'
usb_modeswitch.c:(.text+0x3583): undefined reference to `usb_set_altinterface'
usb_modeswitch.c:(.text+0x359d): undefined reference to `usb_release_interface'
/tmp/cc6y3QfZ.o: In function `switchHuaweiMode':
usb_modeswitch.c:(.text+0x3683): undefined reference to `usb_control_msg'
/tmp/cc6y3QfZ.o: In function `switchSierraMode':
usb_modeswitch.c:(.text+0x3761): undefined reference to `usb_control_msg'
/tmp/cc6y3QfZ.o: In function `switchGCTMode':
usb_modeswitch.c:(.text+0x381b): undefined reference to `usb_claim_interface'
usb_modeswitch.c:(.text+0x38cc): undefined reference to `usb_control_msg'
usb_modeswitch.c:(.text+0x3946): undefined reference to `usb_control_msg'
usb_modeswitch.c:(.text+0x3990): undefined reference to `usb_release_interface'
/tmp/cc6y3QfZ.o: In function `switchKobilMode':
usb_modeswitch.c:(.text+0x3a0d): undefined reference to `usb_control_msg'
/tmp/cc6y3QfZ.o: In function `switchQisdaMode':
usb_modeswitch.c:(.text+0x3b0c): undefined reference to `usb_control_msg'
/tmp/cc6y3QfZ.o: In function `switchQuantaMode':
usb_modeswitch.c:(.text+0x3bef): undefined reference to `usb_control_msg'
/tmp/cc6y3QfZ.o: In function `switchSonyMode':
usb_modeswitch.c:(.text+0x3cf1): undefined reference to `usb_control_msg'
usb_modeswitch.c:(.text+0x3d5f): undefined reference to `usb_close'
usb_modeswitch.c:(.text+0x3d9e): undefined reference to `usb_find_busses'
usb_modeswitch.c:(.text+0x3da3): undefined reference to `usb_find_devices'
usb_modeswitch.c:(.text+0x3ea7): undefined reference to `usb_open'
usb_modeswitch.c:(.text+0x3f9f): undefined reference to `usb_control_msg'
/tmp/cc6y3QfZ.o: In function `switchActionMode':
usb_modeswitch.c:(.text+0x4099): undefined reference to `usb_control_msg'
usb_modeswitch.c:(.text+0x40fa): undefined reference to `usb_control_msg'
usb_modeswitch.c:(.text+0x4127): undefined reference to `usb_interrupt_read'
usb_modeswitch.c:(.text+0x4154): undefined reference to `usb_interrupt_read'
usb_modeswitch.c:(.text+0x419d): undefined reference to `usb_interrupt_write'
usb_modeswitch.c:(.text+0x41ca): undefined reference to `usb_interrupt_read'
usb_modeswitch.c:(.text+0x4213): undefined reference to `usb_interrupt_write'
usb_modeswitch.c:(.text+0x4240): undefined reference to `usb_interrupt_read'
usb_modeswitch.c:(.text+0x4289): undefined reference to `usb_interrupt_write'
usb_modeswitch.c:(.text+0x42bf): undefined reference to `usb_interrupt_read'
usb_modeswitch.c:(.text+0x4312): undefined reference to `usb_interrupt_write'
usb_modeswitch.c:(.text+0x433f): undefined reference to `usb_interrupt_read'
usb_modeswitch.c:(.text+0x4388): undefined reference to `usb_interrupt_write'
usb_modeswitch.c:(.text+0x43b5): undefined reference to `usb_interrupt_read'
usb_modeswitch.c:(.text+0x43fe): undefined reference to `usb_interrupt_write'
usb_modeswitch.c:(.text+0x4434): undefined reference to `usb_interrupt_read'
usb_modeswitch.c:(.text+0x4487): undefined reference to `usb_interrupt_write'
usb_modeswitch.c:(.text+0x44b4): undefined reference to `usb_interrupt_read'
usb_modeswitch.c:(.text+0x44fd): undefined reference to `usb_interrupt_write'
usb_modeswitch.c:(.text+0x452f): undefined reference to `usb_interrupt_read'
/tmp/cc6y3QfZ.o: In function `switchSequansMode':
usb_modeswitch.c:(.text+0x461b): undefined reference to `usb_control_msg'
/tmp/cc6y3QfZ.o: In function `switchCiscoMode':
usb_modeswitch.c:(.text+0x4747): undefined reference to `usb_claim_interface'
usb_modeswitch.c:(.text+0x487d): undefined reference to `usb_release_interface'
usb_modeswitch.c:(.text+0x48cc): undefined reference to `usb_close'
/tmp/cc6y3QfZ.o: In function `detachDriver':
usb_modeswitch.c:(.text+0x493a): undefined reference to `usb_get_driver_np'
usb_modeswitch.c:(.text+0x4a28): undefined reference to `usb_detach_kernel_driver_np'
/tmp/cc6y3QfZ.o: In function `checkSuccess':
usb_modeswitch.c:(.text+0x4c11): undefined reference to `usb_close'
usb_modeswitch.c:(.text+0x4ca1): undefined reference to `usb_claim_interface'
usb_modeswitch.c:(.text+0x4cbb): undefined reference to `usb_release_interface'
usb_modeswitch.c:(.text+0x4cfe): undefined reference to `usb_close'
usb_modeswitch.c:(.text+0x4dd0): undefined reference to `usb_find_busses'
usb_modeswitch.c:(.text+0x4dde): undefined reference to `usb_find_devices'
usb_modeswitch.c:(.text+0x4e9e): undefined reference to `usb_open'
usb_modeswitch.c:(.text+0x4eb5): undefined reference to `usb_close'
/tmp/cc6y3QfZ.o: In function `write_bulk':
usb_modeswitch.c:(.text+0x518e): undefined reference to `usb_bulk_write'
/tmp/cc6y3QfZ.o: In function `read_bulk':
usb_modeswitch.c:(.text+0x5261): undefined reference to `usb_bulk_read'
usb_modeswitch.c:(.text+0x528f): undefined reference to `usb_bulk_read'
/tmp/cc6y3QfZ.o: In function `release_usb_device':
usb_modeswitch.c:(.text+0x5378): undefined reference to `usb_release_interface'
usb_modeswitch.c:(.text+0x5385): undefined reference to `usb_close'
/tmp/cc6y3QfZ.o: In function `search_devices':
usb_modeswitch.c:(.text+0x5420): undefined reference to `usb_get_busses'
usb_modeswitch.c:(.text+0x5979): undefined reference to `usb_open'
/tmp/cc6y3QfZ.o: In function `get_current_configuration':
usb_modeswitch.c:(.text+0x5bd7): undefined reference to `usb_control_msg'
collect2: error: ld returned 1 exit status
Failed to compile usb-modeswitch.

Any ideas?

@Trixarian
Copy link
Owner

I would suggest updating usb-modeswitch from http://www.draisberghof.de/usb_modeswitch/ - but just the binary code since you'll need the custom database (usb-modeswitch-data) to make it work with sakis3g. Just put it in the dependencies folder after you've extracted it and compile.

I'll update everything as soon as I'm back on Linux (which will be within this month). So stay tuned.

@tetherit
Copy link
Author

Updating usb-modeswitch is indeed a working workaround :) - Would be great if you could update it in the repo though.

@Trixarian
Copy link
Owner

True. This problem should pop up in other new distros since usb_modeswitch has fully moved over to libusb 1.0 while I'm still using the one that supports the older libusb. I just need to get my ass in gear and compile my own distro with Buildroot already...

Mind you, you could probably fork and push the change if you want to save others the effort ;)

@Trixarian
Copy link
Owner

Should compile fine on Ubuntu now - Enjoy!

@Trixarian Trixarian added the bug label Jul 22, 2014
@Trixarian Trixarian self-assigned this Jul 22, 2014
@fsmithus
Copy link

I am also trying to compile sakis3g, but on a Raspberry Pi. I have installed libusb-dev, usb-modeswitch, and ppp. I only get one error - "libusb.h: No such file or directory" - apparently when compiling usb-modeswitch. What am I missing? I appreciate your help.

@Trixarian
Copy link
Owner

With some Linuxes the default route to libusb.h isn't where it should be. That's why I added the instrunctions to make it work to the readme file. Just fix the route using one of the following:
Change #include <libusb.h> in dependencies/usb-modeswitch/usb_modeswitch.h to #include <libusb-1.0/libusb.h>
or
sudo cp /usr/include/libusb-1.0/libusb.h /usr/include
or
sudo ln -s /usr/include/libusb-1.0/libusb.h /usr/include/libusb.h

Also make sure you have libusb-1.0-0 and libusb-1.0-0-dev packages installed and not the older libusb packages. It should compile once that's been done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants