Materdaddy / vastfmt

CLI application for VAST Electronics V-FMT212R USB FM Transmitter
2 stars 2 forks source link

DSO missing #2

Open omgomgomgomg opened 9 years ago

omgomgomgomg commented 9 years ago

Hello, I get: $make g++ bitstream.o fmtx.o hid-libusb.o logging.o commands.o radio.o -lusb-1.0 -lm -o radio /usr/bin/ld: hid-libusb.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status Makefile:45: recipe for target 'radio' failed make: *\ [radio] Error 1

already tried it with FLAGS = -L /lib64 LIBS = -lusb-1.0 -lpthread CFLAGS = -I/usr/include/libusb-1.0 -lpthread in Makefile, no success. Any clue what I am missing?

Materdaddy commented 9 years ago

I'd think "-lpthread" should fix it since I don't see that in your build line. What distro are you building on? I presume a 64-bit distro since you're adding a link directory of "/lib64"

omgomgomgomg commented 9 years ago

thank you for your fast response!

I forgot to tell that I tried that as well already:

$make clean rm -f bitstream.o fmtx.o hid-libusb.o logging.o commands.o radio.o $ make -lpthread cc -I/usr/include/libusb-1.0 -lpthread -c -o bitstream.o bitstream.c cc -I/usr/include/libusb-1.0 -lpthread -c -o fmtx.o fmtx.c cc -I/usr/include/libusb-1.0 -lpthread -c -o hid-libusb.o hid-libusb.c cc -I/usr/include/libusb-1.0 -lpthread -c -o logging.o logging.c g++ -std=c++11 -c -o commands.o commands.cpp g++ -std=c++11 -c -o radio.o radio.cpp g++ bitstream.o fmtx.o hid-libusb.o logging.o commands.o radio.o -lusb-1.0 -lm -o radio /usr/bin/ld: hid-libusb.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status Makefile:45: recipe for target 'radio' failed make: *\ [radio] Error 1

And it's Debian 8.0+ amd64

Materdaddy commented 9 years ago

I still don't see -lpthread in your final link, only in the individual object file builds for libusb.

g++ bitstream.o fmtx.o hid-libusb.o logging.o commands.o radio.o -lusb-1.0 -lm -o radio

Try running the final build/link manually and add -lpthread after -lm:

g++ bitstream.o fmtx.o hid-libusb.o logging.o commands.o radio.o -lusb-1.0 -lm -lpthread -o radio

If this fixes it, I'll take a look at what might be needed in the Makefile as a fix.

Materdaddy commented 9 years ago

I've found a few references to a similar failure, I'm wondering if ther's a problem with libusb-1.0 on newer debian installs?

http://stackoverflow.com/questions/25090661/error-linking-libpthread-to-linux-build-of-hidapi https://github.com/signal11/hidapi/issues/149 <-- this might have some clues

omgomgomgomg commented 9 years ago

seems it worked, I got a "radio" binary. I tried $radio -n: as user: ./radio -n Transmission: off Segmentation fault as root: ./radio -n Transmission: off .. but its still transmitting Keith Jarrett ;)