Newsgroup: it.comp.os.linux.development
Titolo: conio.h su Linux

Buongiorno a tutti. Ho provato a scrivere codice e compilare sia in C 
che C++ e i programmi (scritti in precedenza in ambiente windows) 
funzionano (solo qualche piccolo ritocco, ad esempio system("clear") al 
posto di cls, ecc.) l'unico problema è la libreria conio.h. Ne ho 
trovata una versione su 
sourceforge.net
 e l'ho scaricata, ma non so dove 
copiarla. Ho provato nella cartella /usr/lib/gcc (dove sono presenti 
altre librerie con estensione.h, ma non vedo la stdio, la iostream ecc.) 
ma nei programmi in cui la includo mi genera una lunga serie di messaggi 
di errore:
In file included from frase.c:2:
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:52:21: error: 
ncurses.h: No such file or directory
In file included from frase.c:2:
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:91: error: syntax 
error before 'Startuj'
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:92: error: syntax 
error before '{' token
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:103: error: syntax 
error before 'WINDOW'
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:106: error: syntax 
error before 'zainicjowane'
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:106: error: 'FALSE' 
undeclared here (not in a function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:110: error: 
'COLOR_WHITE' undeclared here (not in a function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:111: error: 
'COLOR_BLACK' undeclared here (not in a function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:114: error: syntax 
error before 'okienka'
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:115: error: syntax 
error before '*' token
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h: In function 'inicjuj':
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:128: error: 'stdscr' 
undeclared (first use in this function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:128: error: (Each 
undeclared identifier is reported only once
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:128: error: for each 
function it appears in.)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:128: error: 'TRUE' 
undeclared (first use in this function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:137: error: 'for' loop 
initial declaration used outside C99 mode
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:139: error: 'for' loop 
initial declaration used outside C99 mode
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h: In function 'cgets':
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:179: error: 'ERR' 
undeclared (first use in this function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h: In function 'cprintf':
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:211: error: 'va_list' 
undeclared (first use in this function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:211: error: syntax 
error before 'ap'
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:212: error: 'ap' 
undeclared (first use in this function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h: In function 'cscanf':
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:229: error: 'va_list' 
undeclared (first use in this function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:229: error: syntax 
error before 'ap'
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:230: error: 'ap' 
undeclared (first use in this function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h: In function 'kbhit':
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:290: error: 'ERR' 
undeclared (first use in this function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h: In function 
'textbackground':
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:305: error: 'for' loop 
initial declaration used outside C99 mode
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:307: error: 'for' loop 
initial declaration used outside C99 mode
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h: In function 'textcolor':
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:326: error: 'for' loop 
initial declaration used outside C99 mode
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:328: error: 'for' loop 
initial declaration used outside C99 mode
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h: In function 'window':
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:359: error: 'COLS' 
undeclared (first use in this function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:359: error: 'LINES' 
undeclared (first use in this function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:366: error: 'bool' 
undeclared (first use in this function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:366: error: syntax 
error before 'istnieje'
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:381: error: 'for' loop 
initial declaration used outside C99 mode
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:381: error: 'istnieje' 
undeclared (first use in this function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:384: error: request 
for member 'xup' in something not a structure or union
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:384: error: request 
for member 'yup' in something not a structure or union
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:385: error: request 
for member 'xdown' in something not a structure or union
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:385: error: request 
for member 'ydown' in something not a structure or union
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:387: error: request 
for member 'okno' in something not a structure or union
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:388: error: 'TRUE' 
undeclared (first use in this function)
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:399: error: request 
for member 'okno' in something not a structure or union
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:400: error: request 
for member 'xup' in something not a structure or union
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:401: error: request 
for member 'yup' in something not a structure or union
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:402: error: request 
for member 'xdown' in something not a structure or union
/usr/lib/gcc/i486-linux-gnu/4.0.3/include/conio.h:403: error: request 
for member 'ydown' in something not a structure or union
Come posso risolvere il problema? Potete indicarmi dove trovare una 
versione alternativa, oppure come ovviare alla mancanza di questa 
libreria? Delle funzioni che uso, per ora ho visto che contiene la 
getch. Come IDE sto usando ajuta (in cui però non funziona "esegui", 
dopo la compilazione). Grazie in anticipo.
DENNIS

 getch. 
leggendo il file README o INSTALL che disolito sono allegati a qualsiasi
progetto. e comunque /usr/include non sarebbe stato piu' logico? (no, non
metterlo qui, leggi la documentazione!).
comunque dubito che la cosa si risolva nel copiare solo un header,
probabilmente devi installarti tutta il pacchetto che suppongo ci sia
insieme all'header.
per alternative cerca su freshmeat "conio" e dovrebbero esserci un po' di
progetti, uno mi pare si chiami "linconio"...
ilSimo
-- 
now playing: il tulipano nero
Marble walls are painted red, oh don't give our home free
See our wives and children cry, don't dive into defeat
                                Drakkar - The Walls Of Olathoe

 ncurses.h: No such file or directory
questo è l'errore. Vedi di installare anche le librerire ncurses che di 
sicuro sono già pacchettizzate per la tua distro.
Ciao

 Ciao
Ok, ho installato anche ncurses, scaricato da 
http://sunsite.unc.edu/pub/Linux/libs/ui/linux-conio-1.02.tgz
, copiato 
conio.h in /usr/include e libconio.a in e sembra funzionare tutto 
correttamente: grazie!