Newsgroup: it.comp.os.linux.iniziare
Titolo: radio shark con how to, son bloccato, chi mi aiuta

ho radio shark una radio della griffin mi piace l'aspetto
http://www.griffintechnology.com/products/radioshark/
come distro ho l'ultima di ubuntu
ho trovato anche 2 tutorial per farla funzionare, probabilmente sono
analoghi ma con la mia inesperienza non capisco dove sbaglio
http://wiki.linuxquestions.org/wiki/Audio
http://javier.rodriguez.org.mx/index.php/2006/06/10/griffin-radio-shark-icecast2-on-debian-gnulinux/
seguendo il primo ho:
- installato gcc
- installato ecasound
- installato libhid0... non ho trovato in synapsis libhid
- scaricato il file 
http://javier.rodriguez.org.mx/code/shark.c
 nella home
- lanciato il comando gcc -g -o $@ -lhid shark.c
e qui mi blocco con questa serie di errori
shark.c:13:19: error: stdio.h: Nessun file o directory
shark.c:14:20: error: string.h: Nessun file o directory
shark.c:15:20: error: unistd.h: Nessun file o directory
shark.c:16:17: error: hid.h: Nessun file o directory
shark.c: In function ‘usage’:
shark.c:19: warning: incompatible implicit declaration of built-in function
‘printf’
shark.c: In function ‘main’:
shark.c:31: error: ‘hid_return’ undeclared (first use in this function)
shark.c:31: error: (Each undeclared identifier is reported only once
shark.c:31: error: for each function it appears in.)
shark.c:31: error: syntax error before ‘ret’
shark.c:32: error: ‘HIDInterface’ undeclared (first use in this function)
shark.c:32: error: ‘hid’ undeclared (first use in this function)
shark.c:33: error: ‘HIDInterfaceMatcher’ undeclared (first use in this
function)shark.c:33: error: syntax error before ‘matcher’
shark.c: At top level:
shark.c:40: error: syntax error before ‘if’
shark.c:44: error: conflicting types for ‘encodedFreq’
shark.c:37: error: previous declaration of ‘encodedFreq’ was here
shark.c:44: warning: data definition has no type or storage class
shark.c:45: error: conflicting types for ‘freq’
shark.c:38: error: previous declaration of ‘freq’ was here
shark.c:45: error: ‘argv’ undeclared here (not in a function)
shark.c:45: error: initializer element is not constant
shark.c:45: warning: data definition has no type or storage class
shark.c:46: error: conflicting types for ‘encodedFreq’
shark.c:37: error: previous declaration of ‘encodedFreq’ was here
shark.c:46: error: initializer element is not constant
shark.c:46: warning: data definition has no type or storage class
shark.c:47: error: syntax error before ‘+=’ token
shark.c:48: error: conflicting types for ‘PACKET’
shark.c:36: error: previous definition of ‘PACKET’ was here
shark.c:48: error: invalid initializer
shark.c:48: warning: data definition has no type or storage class
shark.c:49: error: conflicting types for ‘PACKET’
shark.c:36: error: previous definition of ‘PACKET’ was here
shark.c:49: error: invalid initializer
shark.c:49: warning: data definition has no type or storage class
shark.c:50: error: syntax error before ‘if’
shark.c:52: error: syntax error before string constant
shark.c:52: warning: conflicting types for built-in function ‘printf’
shark.c:52: warning: data definition has no type or storage class
shark.c:53: error: syntax error before string constant
shark.c:58: error: conflicting types for ‘encodedFreq’
shark.c:37: error: previous declaration of ‘encodedFreq’ was here
shark.c:58: warning: data definition has no type or storage class
shark.c:59: error: conflicting types for ‘freq’
shark.c:38: error: previous declaration of ‘freq’ was here
shark.c:59: error: initializer element is not constant
shark.c:59: warning: data definition has no type or storage class
shark.c:60: error: conflicting types for ‘encodedFreq’
shark.c:37: error: previous declaration of ‘encodedFreq’ was here
shark.c:60: error: initializer element is not constant
shark.c:60: warning: data definition has no type or storage class
shark.c:61: error: conflicting types for ‘PACKET’
shark.c:36: error: previous definition of ‘PACKET’ was here
shark.c:61: error: invalid initializer
shark.c:61: warning: data definition has no type or storage class
shark.c:62: error: conflicting types for ‘PACKET’
shark.c:36: error: previous definition of ‘PACKET’ was here
shark.c:62: error: invalid initializer
shark.c:62: warning: data definition has no type or storage class
shark.c:63: error: conflicting types for ‘PACKET’
shark.c:36: error: previous definition of ‘PACKET’ was here
shark.c:63: error: invalid initializer
shark.c:63: warning: data definition has no type or storage class
shark.c:64: error: syntax error before ‘if’
shark.c:66: error: syntax error before string constant
shark.c:67: error: syntax error before string constant
shark.c:72: error: conflicting types for ‘PACKET’
shark.c:36: error: previous definition of ‘PACKET’ was here
shark.c:72: error: invalid initializer
shark.c:72: warning: data definition has no type or storage class
shark.c:73: error: conflicting types for ‘PACKET’
shark.c:36: error: previous definition of ‘PACKET’ was here
shark.c:73: error: invalid initializer
shark.c:73: warning: data definition has no type or storage class
shark.c:74: error: syntax error before ‘}’ token
shark.c:77: error: conflicting types for ‘PACKET’
shark.c:36: error: previous definition of ‘PACKET’ was here
shark.c:77: error: invalid initializer
shark.c:77: warning: data definition has no type or storage class
shark.c:78: error: conflicting types for ‘PACKET’
shark.c:36: error: previous definition of ‘PACKET’ was here
shark.c:78: error: invalid initializer
shark.c:78: warning: data definition has no type or storage class
shark.c:79: error: syntax error before ‘}’ token
shark.c:84: error: conflicting types for ‘PACKET’
shark.c:36: error: previous definition of ‘PACKET’ was here
shark.c:84: error: invalid initializer
shark.c:84: warning: data definition has no type or storage class
shark.c:85: error: syntax error before ‘}’ token
shark.c:88: error: syntax error before numeric constant
shark.c:88: warning: conflicting types for built-in function ‘exit’
shark.c:88: warning: data definition has no type or storage class
shark.c:92: error: syntax error before numeric constant
shark.c:92: warning: data definition has no type or storage class
shark.c:98: warning: parameter names (without types) in function
declaration
shark.c:98: warning: data definition has no type or storage class
shark.c:99: error: syntax error before numeric constant
shark.c:99: warning: data definition has no type or storage class
shark.c:103: error: initializer element is not constant
shark.c:103: warning: data definition has no type or storage class
shark.c:104: error: syntax error before ‘if’
shark.c:110: error: initializer element is not constant
shark.c:110: warning: data definition has no type or storage class
shark.c:111: error: syntax error before ‘if’
shark.c:117: error: redefinition of ‘ret’
shark.c:103: error: previous definition of ‘ret’ was here
shark.c:117: error: ‘matcher’ undeclared here (not in a function)
shark.c:117: error: initializer element is not constant
shark.c:117: warning: data definition has no type or storage class
shark.c:118: error: syntax error before ‘if’
shark.c:124: error: redefinition of ‘ret’
shark.c:103: error: previous definition of ‘ret’ was here
shark.c:124: error: initializer element is not constant
shark.c:124: warning: data definition has no type or storage class
shark.c:125: error: syntax error before ‘if’
shark.c:128: error: redefinition of ‘ret’
shark.c:103: error: previous definition of ‘ret’ was here
shark.c:128: error: initializer element is not constant
shark.c:128: warning: data definition has no type or storage class
shark.c:129: error: syntax error before ‘if’
shark.c:135: error: syntax error before ‘&’ token
shark.c:135: warning: data definition has no type or storage class
shark.c:138: error: redefinition of ‘ret’
shark.c:103: error: previous definition of ‘ret’ was here
shark.c:138: error: initializer element is not constant
shark.c:138: warning: data definition has no type or storage class
shark.c:139: error: syntax error before ‘if’

 shark.c:16:17: error: hid.h: Nessun file o directory
Se devi compilare, oltre al gccti servono anche gli headers, e probabilmente
le binutils. I messaggi sopra indicano che ti mancano gli heder standard
del C, o che comunque il compilatore non riesce a trovarli.
Ciao.

Alex wrote:

Ciao, grazie devo dire che ho fatto grossi passi avanti :)
ora mi blocco qui
$ gcc -g -o shark -lhid shark.c
/tmp/ccGt4lsy.o: In function `main':/home/al404/shark.c:124: undefined
reference to `hid_interrupt_write'
collect2: ld returned 1 exit status
ripoto il link del tutorial, c'è anche il file shark.c
http://javier.rodriguez.org.mx/index.php/2006/06/10/griffin-radio-shark-icecast2-on-debian-gnulinux/
-- 
Al

 
...e libhid-dev l'hai installato, vero??
E' fra i prerequisiti indicati nel tutorial, ma nel tuo primo post non ne
fai menzione...
Ciao.

 fai menzione...
ho installato un po' di tutto, e da synaptic risulta ma l'ho reinstallato
per sicurezza ma nulla da fare sempre lo stesso errore
-- 
Al

Al wrote:

...allora non so che dirti, mi spiace. Il messaggio di errore e' del linker,
quindi si riferisce quasi sicuramente ad una libreria mancante, anzi per
essere piu' precisi il linker non trova la funzione `hid_interrupt_write',
chiamata dal file shark.c, in nessuna libreria . Dal prefisso si puo'
dedurre che dovrebbe trovarsi in libhid, ma a quanto pare non e' cosi'..:-(
Se vuoi verificare prova con :
 nm -C -D /usr/lib/libhid.xx.yy | grep 'hid_interrupt_write'
(ovviamente controlla il path  e gli xx.yy .. :-)) )
Forse la versione della libreria non e' quella richiesta, controlla se ne
esistono versioni + o - nuove e riprova con quelle.
Altra prova da fare e' lanciare ldconfig prima della compilazione, ma a
regola dovrebbe gia' averlo fatto il packet manager quando hai installato
la libreria.
Ciao.

 Ciao.
-- 
Al

 Ciao
Ciao
Credo di aver trovato qualche cosa ma non so tradurlo in fatti... avrei
bisogno di una mano :)
http://www.advogato.org/person/titus/diary.html?start=156
guarda qui dove dice
Spend several hours playing around with libhid, only to figure out that
Michael Rolig is using the latest Subversion checkout of libhid and I can't
figure out how to compile it. (See my complaint about autof*ck, above).
Ultimately,
   1. grab the latest release of libhid;
   2. patch it with the Debian stuff;
   3. monkey-patch in the interrupt_write function;
   4. rebuild 
(Shockingly, this worked!) 
su libhid c'è questo link
http://libhid.alioth.debian.org/
e Michael Rolig dovrebbe essere il tizio che ha scritto il file c che sto
cercando di compilare
-- 
Al

> Ciao.
Ciao. 

 Ciao.
-- 
Al

 volevo anche ringraziarti per la pazienza :)
Speriamo che sia la volta buona! :-)
Ciao.

 
purtroppo quelle seno quelle che installa anche in automatico synaptic
ho ripreso l'altra strada e...
installato docbook-utils
poi mancava sempre quel file
# updatedb
$ locate docbook.xsl
poi
$ cd /usr/share/sgml/docbook/stylesheet/
$ sudo mkdir xsl
$ cd xsl
$ sudo mkdir nwalsh
$ sudo mkdir manpages
lo trova e l'ho copiata
cp /usr/share/apps/ksgmltools2/docbook/xsl/html/docbook.xsl /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
dopo ho cancellato la dir
poi
svn co svn://
svn.debian.org/libhid/trunk
 libhid-svn 
cd libhid-svn
./autogen.sh
make
qui ma ha stampato una pappina lunghissima
make install
anche qui ma ha stampato una pappina lunghissima
ldconfig
quando però ho dato
gcc -g -o shark -L/usr/local/lib -lhid shark.c
mi ha ristampato tutti gli errori che mi dava all'inizio del post
come faccio a vedere se libhid l'ho installato correttamente?
lo posso cercare da qualche parte?
-- 
Al

 lo posso cercare da qualche parte?
Se hai compilato senza particolari opzioni la libreria dovrebbe essere
in /usr/local/lib
Ciao.