on1arf / voice-ann

D-STAR voice-announcement system
http://villazeebries.krbonne.net/hamstuff
GNU General Public License v2.0
10 stars 6 forks source link

Trying to build on Ubuntu #1

Closed m1geo closed 9 years ago

m1geo commented 9 years ago

Hello.

I'm having trouble building this on Ubuntu. I have the required libraries installed (via libsndfile1-dev on Ubuntu repos).

Any help would be greatly appreciated.

Thanks George M1GEO.

george@marconi:~/voice-ann$ make gcc -Wall -o wav2ambe -lpthread -lsndfile -lrt wav2ambe.c In file included from wav2ambe.c:88:0: serialsend.h: In function ‘funct_serialsend’: serialsend.h:10:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] int ret; ^ In file included from wav2ambe.c:93:0: serialreceive.h: In function ‘funct_serialreceive’: serialreceive.h:305:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] int ret; ^ /tmp/ccLZmQNp.o: In function main': wav2ambe.c:(.text+0x1b8d): undefined reference topthread_create' wav2ambe.c:(.text+0x1c59): undefined reference to timer_create' wav2ambe.c:(.text+0x1cdf): undefined reference totimer_settime' wav2ambe.c:(.text+0x1d78): undefined reference to sf_open_fd' wav2ambe.c:(.text+0x1dd4): undefined reference tosf_open' wav2ambe.c:(.text+0x1e4d): undefined reference to sf_close' wav2ambe.c:(.text+0x1e8a): undefined reference tosf_close' wav2ambe.c:(.text+0x1ec9): undefined reference to sf_close' wav2ambe.c:(.text+0x1f80): undefined reference tosf_read_short' wav2ambe.c:(.text+0x204c): undefined reference to sf_close' wav2ambe.c:(.text+0x20e1): undefined reference totimer_settime' collect2: error: ld returned 1 exit status make: *\ [wav2ambe] Error 1 george@marconi:~/voice-ann$

on1arf commented 9 years ago

George,

There has been a change in gcc where that -if you link to external libraries- you need to put them at the end of the command-line paramters. This should work:

gcc -Wall -o wav2ambe wav2ambe.c -lpthread -lsndfile -lrt

(so the "-l"s have to be put at the end).

I will correct the Makefile, but you can already compile the applications yourself if you apply this trick.

73 kristoff - ON1ARF

m1geo commented 9 years ago

Thanks. I will try this tomorrow! :) George M1GEO. Keeper of GB7KH.