Re: Problemilla de C
Julián Albo dijo:
> Algo así te puede valer:
Sí, muchísimas gracias.
> char * aux;
> aux= getenv ("EDITOR");
> if (aux != NULL) doc_command= aux;
> else {
> aux= getenv ("VISUAL");
> if (aux != NULL)
> doc_command= aux;
> else
> doc_command= DOC_COMMAND;
> }
Al final he plantado esto:
#define DOC_COMMAND "/usr/bin/sensible-editor"
char *doc_command
char *aux = getenv("EDITOR");
if (aux != NULL) doc_command = aux;
else {
aux = getenv("VISUAL");
if (aux != NULL)
doc_command = aux;
else
doc_command = DOC_COMMAND;
}
Pero al compilar:
-DHAVE_CONFIG_H -I. -I. -I. -I/usr/X11R6/include -O2 -Wall -c fkiss.c
fkiss.c:113: syntax error before `char'
fkiss.c:113: initializer element is not constant
fkiss.c:115: parse error before `if'
fkiss.c:1875: `doc_command' undeclared here (not in a function)
fkiss.c:1875: initializer element is not constant
fkiss.c:1875: (near initialization for `opttbl[73].parm')
fkiss.c:1876: `doc_command' undeclared here (not in a function)
fkiss.c:1876: initializer element is not constant
fkiss.c:1876: (near initialization for `opttbl[74].parm')
fkiss.c: In function `browse_document':
fkiss.c:2330: `doc_command' undeclared (first use in this function)
fkiss.c:2330: (Each undeclared identifier is reported only once
fkiss.c:2330: for each function it appears in.)
make[1]: *** [fkiss.o] Error 1
make[1]: Leaving directory `/home/amaya/debian-packages/fkiss/fkiss-0.33a'
Qué estrés... ¿?
¿Alguna lista de C que esté bien?
--
.''`. We shall drag a world with us, a world in flames
: :' : - Baden
`. `' Proudly running Debian GNU/Linux Sid (Kernel 2.4.14)
`- www.amayita.com www.malapecora.com www.chicasduras.com
Listening to Joaquín Sabina - La_casa_por_la_ventana
Reply to: