PDA

Visualizza la versione completa : [C] compilazione linux


edel
05-10-2008, 12:19
Qualcuno sa aiutarmi a decodificare i seguenti errori e a risolverli???
Grazie.

[ CODE] ariel@ubuntu:~/a-saodv $ make
grep: /lib/modules/2.6.8.1-3-386/build/Makefile: No such file or directory
gcc -Wall -pthread -g -DDEBUG -c -o main.o main.c
main.c:38:20: gcrypt.h: No such file or directory
main.c:39: warning: type defaults to `int' in declaration of `GCRY_THREAD_OPTION_PTHREAD_IMPL'
main.c:39: warning: data definition has no type or storage class
In file included from main.c:52:
key.h:29:20: gcrypt.h: No such file or directory
In file included from main.c:52:
key.h:36: error: parse error before "my_priv_key"
key.h:36: warning: type defaults to `int' in declaration of `my_priv_key'
key.h:36: warning: data definition has no type or storage class
key.h:37: error: parse error before "my_pub_key"
key.h:37: warning: type defaults to `int' in declaration of `my_pub_key'
key.h:37: warning: data definition has no type or storage class
key.h:38: error: parse error before "my_key_handle"
key.h:38: warning: type defaults to `int' in declaration of `my_key_handle'
key.h:38: warning: data definition has no type or storage class
key.h:39: error: parse error before "my_key_alg"
key.h:39: warning: type defaults to `int' in declaration of `my_key_alg'
key.h:39: warning: data definition has no type or storage class
key.h:45: error: parse error before "gcry_ac_key_t"
key.h:45: warning: no semicolon at end of struct or union
key.h:46: warning: type defaults to `int' in declaration of `alg'
key.h:46: warning: data definition has no type or storage class
key.h:47: error: parse error before "handle"
key.h:47: warning: type defaults to `int' in declaration of `handle'
key.h:47: warning: data definition has no type or storage class
key.h:71: error: parse error before "gcry_ac_key_t"
key.h:74: error: parse error before "gcry_ac_id_t"
key.h:77: error: parse error before "gcry_ac_handle_t"
In file included from main.c:53:
crypto.h:29:20: gcrypt.h: No such file or directory
In file included from main.c:53:
crypto.h:89: error: parse error before "gcry_ac_id_t"
crypto.h:93: error: parse error before "gcry_ac_id_t"
crypto.h:98: error: parse error before "sign_to_gcrypt"
crypto.h:98: warning: type defaults to `int' in declaration of `sign_to_gcrypt'
crypto.h:98: warning: data definition has no type or storage class
main.c: In function `main':
main.c:571: warning: implicit declaration of function `gcry_control'
main.c:571: error: `GCRYCTL_SET_THREAD_CBS' undeclared (first use in this function)
main.c:571: error: (Each undeclared identifier is reported only once
main.c:571: error: for each function it appears in.)
main.c:571: error: `gcry_threads_pthread' undeclared (first use in this function)
main.c:572: error: `GCRYCTL_DISABLE_SECMEM' undeclared (first use in this function)
main.c:573: warning: implicit declaration of function `gcry_check_version'
main.c:573: error: `GCRYPT_VERSION' undeclared (first use in this function)
main.c:667: warning: implicit declaration of function `gcry_md_map_name'
make: *** [main.o] Error 1
[/ CODE]

oregon
05-10-2008, 12:21
Beh ... la prima cosa che risolverei se fossi in te e'

main.c:38:20: gcrypt.h: No such file or directory

ovvero, perche' non viene trovato l'include

gcrypt.h

Devo presumere che

1) il file manca

2) non e' in una cartella che il compilatore si aspetta ...

edel
05-10-2008, 12:35
La cartella esiste...

Ma prima di capire questo, perchč come prima riga mi viene visualizzata:
grep: /lib/modules/2.6.8.1-3-386/build/Makefile: No such file or directory???



Originariamente inviato da edel
Qualcuno sa aiutarmi a decodificare i seguenti errori e a risolverli???
Grazie.

[ CODE] ariel@ubuntu:~/a-saodv $ make
grep: /lib/modules/2.6.8.1-3-386/build/Makefile: No such file or directory
gcc -Wall -pthread -g -DDEBUG -c -o main.o main.c
main.c:38:20: gcrypt.h: No such file or directory
main.c:39: warning: type defaults to `int' in declaration of `GCRY_THREAD_OPTION_PTHREAD_IMPL'
main.c:39: warning: data definition has no type or storage class
In file included from main.c:52:
key.h:29:20: gcrypt.h: No such file or directory
In file included from main.c:52:
key.h:36: error: parse error before "my_priv_key"
key.h:36: warning: type defaults to `int' in declaration of `my_priv_key'
key.h:36: warning: data definition has no type or storage class
key.h:37: error: parse error before "my_pub_key"
key.h:37: warning: type defaults to `int' in declaration of `my_pub_key'
key.h:37: warning: data definition has no type or storage class
key.h:38: error: parse error before "my_key_handle"
key.h:38: warning: type defaults to `int' in declaration of `my_key_handle'
key.h:38: warning: data definition has no type or storage class
key.h:39: error: parse error before "my_key_alg"
key.h:39: warning: type defaults to `int' in declaration of `my_key_alg'
key.h:39: warning: data definition has no type or storage class
key.h:45: error: parse error before "gcry_ac_key_t"
key.h:45: warning: no semicolon at end of struct or union
key.h:46: warning: type defaults to `int' in declaration of `alg'
key.h:46: warning: data definition has no type or storage class
key.h:47: error: parse error before "handle"
key.h:47: warning: type defaults to `int' in declaration of `handle'
key.h:47: warning: data definition has no type or storage class
key.h:71: error: parse error before "gcry_ac_key_t"
key.h:74: error: parse error before "gcry_ac_id_t"
key.h:77: error: parse error before "gcry_ac_handle_t"
In file included from main.c:53:
crypto.h:29:20: gcrypt.h: No such file or directory
In file included from main.c:53:
crypto.h:89: error: parse error before "gcry_ac_id_t"
crypto.h:93: error: parse error before "gcry_ac_id_t"
crypto.h:98: error: parse error before "sign_to_gcrypt"
crypto.h:98: warning: type defaults to `int' in declaration of `sign_to_gcrypt'
crypto.h:98: warning: data definition has no type or storage class
main.c: In function `main':
main.c:571: warning: implicit declaration of function `gcry_control'
main.c:571: error: `GCRYCTL_SET_THREAD_CBS' undeclared (first use in this function)
main.c:571: error: (Each undeclared identifier is reported only once
main.c:571: error: for each function it appears in.)
main.c:571: error: `gcry_threads_pthread' undeclared (first use in this function)
main.c:572: error: `GCRYCTL_DISABLE_SECMEM' undeclared (first use in this function)
main.c:573: warning: implicit declaration of function `gcry_check_version'
main.c:573: error: `GCRYPT_VERSION' undeclared (first use in this function)
main.c:667: warning: implicit declaration of function `gcry_md_map_name'
make: *** [main.o] Error 1
[/ CODE]

menphisx
05-10-2008, 14:23
La cartella esiste, ma il file evidentemente no :fagiano:

edel
06-10-2008, 11:14
grep: /lib/modules/2.6.8.1-3-386/build/Makefile: No such file or directory

E' sparito dopo aver scaricato gli headers del kernel col seguente comando:
# apt-get install kernel-headers-2.6.8-1-386.

Manca il file crypto.h...ovvero la libreria libgpg-error...
Ai prossimi aggiornamenti. :ciauz:

edel
07-10-2008, 21:16
Allora...
ho installato le due librerie utili a farmi girare il programma: libgpg-error e libgcrypt.

Ok, non ho pių gli errori di prima..ma ora ho questo elenco che non so ben interpretare..qualcuno mi sa dare uan mano???
Grazie


warty@ubuntu:~/a-saodv/a-saodv_1 $ make
gcc -Wall -pthread -g -DDEBUG -c -o main.o main.c
gcc -Wall -pthread -g -DDEBUG -c -o list.o list.c
gcc -Wall -pthread -g -DDEBUG -c -o debug.o debug.c
gcc -Wall -pthread -g -DDEBUG -c -o timer_queue.o timer_queue.c
gcc -Wall -pthread -g -DDEBUG -c -o aodv_socket.o aodv_socket.c
gcc -Wall -pthread -g -DDEBUG -c -o aodv_hello.o aodv_hello.c
gcc -Wall -pthread -g -DDEBUG -c -o aodv_neighbor.o aodv_neighbor.c
gcc -Wall -pthread -g -DDEBUG -c -o aodv_timeout.o aodv_timeout.c
gcc -Wall -pthread -g -DDEBUG -c -o routing_table.o routing_table.c
gcc -Wall -pthread -g -DDEBUG -c -o seek_list.o seek_list.c
gcc -Wall -pthread -g -DDEBUG -c -o k_route.o k_route.c
gcc -Wall -pthread -g -DDEBUG -c -o aodv_rreq.o aodv_rreq.c
gcc -Wall -pthread -g -DDEBUG -c -o aodv_rrep.o aodv_rrep.c
gcc -Wall -pthread -g -DDEBUG -c -o aodv_rerr.o aodv_rerr.c
gcc -Wall -pthread -g -DDEBUG -c -o packet_input.o packet_input.c
gcc -Wall -pthread -g -DDEBUG -c -o packet_queue.o packet_queue.c
gcc -Wall -pthread -g -DDEBUG -c -o libipq.o libipq.c
gcc -Wall -pthread -g -DDEBUG -c -o icmp.o icmp.c
gcc -Wall -pthread -g -DDEBUG -c -o saodv_rreq.o saodv_rreq.c
gcc -Wall -pthread -g -DDEBUG -c -o saodv_rrep.o saodv_rrep.c
gcc -Wall -pthread -g -DDEBUG -c -o saodv_rerr.o saodv_rerr.c
gcc -Wall -pthread -g -DDEBUG -c -o key.o key.c
gcc -Wall -pthread -g -DDEBUG -c -o hash.o hash.c
gcc -Wall -pthread -g -DDEBUG -c -o crypto.o crypto.c
gcc -Wall -pthread -g -DDEBUG -c -o saodv_adapt.o saodv_adapt.c
gcc -Wall -pthread -g -DDEBUG -lgcrypt -lgpg-error -o saodvd main.o list.o debu g.o timer_queue.o aodv_socket.o aodv_hello.o aodv_neighbor.o aodv_timeout.o routing_table.o seek_list.o k_route.o aodv_rreq.o aodv_rrep.o aodv_rerr.o packet_input.o packet_queue.o libipq.o icmp.o saodv_rreq.o saodv_rrep.o saodv_rerr.o key.o hash.o crypto.o saodv_adapt.o
make -C /lib/modules/2.6.8.1-3-386/build SUBDIRS=/home/warty/a-saodv/a-saodv_1 modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.8.1-3-386'
CC [M] /home/warty/a-saodv/a-saodv_1/kaodv.o
/home/warty/a-saodv/a-saodv_1/kaodv.c:202: error: invalid lvalue in unary `&'/home/warty/a-saodv/a-saodv_1/kaodv.c:202: error: initializer element is not constant
/home/warty/a-saodv/a-saodv_1/kaodv.c:202: error: (near initialization for `__param_arr_ifname.num')
make[2]: *** [/home/warty/a-saodv/a-saodv_1/kaodv.o] Error 1
make[1]: *** [_module_/home/warty/a-saodv/a-saodv_1] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.8.1-3-386'
make: *** [kaodv.ko] Error 2

edel
07-10-2008, 21:48
Compilando nuovamente ora ho la seguente schermata...che č quella DEFINITIVA e sulla quale chiedo la vostra collaborazione per capire di che si tratta. Grazie


warty@ubuntu:~/a-saodv/a-saodv_1 $ make
make -C /lib/modules/2.6.8.1-3-386/build SUBDIRS=/home/warty/a-saodv/a-saodv_1 modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.8.1-3-386'
CC [M] /home/warty/a-saodv/a-saodv_1/kaodv.o
/home/warty/a-saodv/a-saodv_1/kaodv.c:202: error: invalid lvalue in unary `&'
/home/warty/a-saodv/a-saodv_1/kaodv.c:202: error: initializer element is not constant
/home/warty/a-saodv/a-saodv_1/kaodv.c:202: error: (near initialization for `__param_arr_ifname.num')
make[2]: *** [/home/warty/a-saodv/a-saodv_1/kaodv.o] Error 1
make[1]: *** [_module_/home/warty/a-saodv/a-saodv_1] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.8.1-3-386'
make: *** [kaodv.ko] Error 2

menphisx
07-10-2008, 22:01
/home/warty/a-saodv/a-saodv_1/kaodv.c:202: error: invalid lvalue in unary `&'


Posta linea, da 200 a 210, di quel file.

:ciauz:

edel
07-10-2008, 23:44
#ifdef KERNEL26
static int num_parms = 0;
/* Modified by MAIS-TEAM - kernel > 2.6.9 compatibility */
module_param_array(ifname, charp, &num_parms, 0);
module_param(qual_th, int, 0);
#else
MODULE_PARM(ifname, "1-" __MODULE_STRING(MAX_INTERFACES) "s");
MODULE_PARM(qual_th, "i");
#endif

static struct nf_hook_ops kaodv_ops[] = {
{



Ecco...sto usando gcc 3.3.4.
kernel 2.6.8.1-3-386
ubuntu 4.10
:ciauz:

menphisx
07-10-2008, 23:53
Prova cosė (fai pero prima un backup del file):


#ifdef KERNEL26
static int num_parms = 0;
/* Modified by MAIS-TEAM - kernel > 2.6.9 compatibility */
module_param_array(ifname, charp, num_parms, 0);
module_param(qual_th, int, 0);
#else
MODULE_PARM(ifname, "1-" __MODULE_STRING(MAX_INTERFACES) "s");
MODULE_PARM(qual_th, "i");
#endif


:fagiano:

:ciauz:

Loading