|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Member
Iscritto dal: Apr 2007
Città: calafrica
Messaggi: 196
|
[C] undefined reference to...
sto cross-compilando per ARM l'implementazione del protocollo AODV della Uppsala University, ma ottengo una serie di errori del tipo:
Codice:
main.o: In function `cleanup': main.c:(.text+0x1b0): undefined reference to `rt_table_destroy' [code]#include "routing_table.h[\CODE] siccome sono abbastanza niubba in programmazione, mi sapreste dire come risolvere? in un post simile ho letto che bisogna effettuare un linking, ma siccome il comando che dò per la cross compilazione è om-conf, non so come risolvere! OK facendo un attimino funzionare la testa, ho modificato un makefile.am (aggiungendo semplicemente un "\" e andando a capo per elencare tutti i sorgenti) ed ho risolto questo problema. purtroppo ne è sorto un altro: [code] In file included from llf.c:23: debug.h:56:25: warning: ISO C does not permit named variadic macros In file included from /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/linux/rtnetlink.h:5, from llf.c:34: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/linux/if_link.h:43: error: expected specifier-qualifier-list before ‘__u64’ In file included from /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/linux/rtnetlink.h:7, from llf.c:34: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/linux/neighbour.h:92: error: expected specifier-qualifier-list before ‘__u64’ llf.c:36:19: error: iwlib.h: Nessun file o directory llf.c: In function ‘llf_rtnl_open’: llf.c:106: warning: pointer targets in passing argument 3 of ‘getsockname’ differ in signedness llf.c: In function ‘index2name’: llf.c:150: error: storage size of ‘irq’ isn’t known llf.c:150: warning: unused variable ‘irq’ llf.c: In function ‘iw_get_interface_data’: llf.c:186: warning: implicit declaration of function ‘iw_sockets_open’ llf.c:206: warning: implicit declaration of function ‘iw_get_range_info’ llf.c:210: warning: implicit declaration of function ‘iw_sockets_close’ llf.c: In function ‘mac_to_ip’: llf.c:242: warning: format ‘%x’ expects type ‘unsigned int *’, but argument 4 has type ‘int *’ llf.c:242: warning: format ‘%x’ expects type ‘unsigned int *’, but argument 5 has type ‘int *’ llf.c:246: warning: implicit declaration of function ‘iw_ether_aton’ llf.c: In function ‘llf_print_event’: llf.c:264: warning: unused variable ‘buffer’ llf.c: In function ‘llf_handle_netlink_events’: llf.c:347: warning: pointer of type ‘void *’ used in arithmetic llf.c:353: error: storage size of ‘stream’ isn’t known llf.c:369: warning: implicit declaration of function ‘iw_init_event_stream’ llf.c:371: warning: pointer of type ‘void *’ used in arithmetic llf.c:385: warning: implicit declaration of function ‘iw_extract_event_stream’ llf.c:353: warning: unused variable ‘stream’ [\CODE] qui c'è il codice: https://prj.tzi.org/cgi-bin/trac.cgi/browser/aodv-uu-dtn/trunk/llf.c Ultima modifica di yashi79 : 11-01-2010 alle 02:08. Motivo: nuovo problema, risolto il precedente |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Jul 2002
Città: Milano
Messaggi: 19148
|
vedo che non riesce a trovare iwlib.h
hai il wireless tool? mi pare faccia parte di quel pacchetto comincia a risolvere quello, poi vediamo se saltano fuori altri casini |
![]() |
![]() |
![]() |
#3 | |
Member
Iscritto dal: Apr 2007
Città: calafrica
Messaggi: 196
|
Quote:
non so se è un problema di compilatore a questo punto, cmq gli ultimi errori che ho sono questi: I Codice:
n file included from llf.c:23: debug.h:56:25: warning: ISO C does not permit named variadic macros In file included from /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/linux/rtnetlink.h :6, from llf.c:35: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/linux/if_link.h: 43: error: expected specifier-qualifier-list before ‘__u64’ In file included from /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/linux/rtnetlink.h :8, from llf.c:35: /usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr/include/linux/neighbour.h :92: error: expected specifier-qualifier-list before ‘__u64’ llf.c: In function ‘llf_rtnl_open’: llf.c:106: warning: pointer targets in passing argument 3 of ‘getsockname’ differ in signedness llf.c: In function ‘mac_to_ip’: llf.c:242: warning: format ‘%x’ expects type ‘unsigned int *’, but argument 4 has type ‘int *’ llf.c:242: warning: format ‘%x’ expects type ‘unsigned int *’, but argument 5 has type ‘int *’ llf.c: In function ‘llf_print_event’: llf.c:264: warning: unused variable ‘buffer’ llf.c: In function ‘llf_handle_netlink_events’: llf.c:347: warning: pointer of type ‘void *’ used in arithmetic llf.c:371: warning: pointer of type ‘void *’ used in arithmetic |
|
![]() |
![]() |
![]() |
#4 |
Senior Member
Iscritto dal: Jul 2002
Città: Milano
Messaggi: 19148
|
mi sa che non è definito il tipo _u64
forse puoi provare a togliere qualche flag di compilazione. vedendo anche quel warning su debug.h pare che ci sia una cflag che fa riferimento a c99 e può dare problemi con la cross-compilazione evidentemente quelli che hanno rilasciato l'implementazione di AODV hanno sempre compilato in un ambiente che non dava questi casini perché non è un problema di codice |
![]() |
![]() |
![]() |
#5 | |
Member
Iscritto dal: Apr 2007
Città: calafrica
Messaggi: 196
|
Quote:
mi resta da chiarire un punto su una funzione: Codice:
OLSR_FOR_ALL_LINK_ENTRIES(link) { struct default_lq_ff_hello *tlq = (struct default_lq_ff_hello *)link->linkquality; // fpm ratio; float ratio; int i, received, total; received = 0; total = 0; /* enlarge window if still in quickstart phase */ if (tlq->windowSize < LQ_FF_WINDOW) { tlq->windowSize++; } for (i = 0; i < tlq->windowSize; i++) { received += tlq->received[i]; total += tlq->total[i]; } L'unica tipologia di problema che rimane è Codice:
lq_plugin_default_ff.c:244: warning: implicit declaration of function ‘fpmidiv’ |
|
![]() |
![]() |
![]() |
#6 |
Senior Member
Iscritto dal: Jul 2002
Città: Milano
Messaggi: 19148
|
non saprei non ho in mente cos'è fpm, immagino che prima ti dicesse che non sapeva di che tipo fosse "fpm"
per quanto riguarda le dichiarazioni implicite probabilmente hai solo un warning, perché in fase di link trova le funzioni. per far sparire quei warning i casi sono due: o c'è un .h che non è incluso, dove tali funzioni vengono definite, oppure non esiste proprio il .h e in quel caso basterebbe aggiungere i prototipi a mano |
![]() |
![]() |
![]() |
#7 |
Member
Iscritto dal: Apr 2007
Città: calafrica
Messaggi: 196
|
quello che ho capito è che fpm è un tipo definito nella libreria fpm.h (inclusa nell'intestazione #include"fpm.h");
quelloche nn riesco a fare è cross compilare le librerie per la mia toolchain; in pratica io nella cartella src ho i file *.c ed *.h, e per installare nuove librerie nella toolchain adatto questi comandi: Codice:
cd ~/source wget http://downloads.sourceforge.net/uriparser/uriparser-0.6.0.tar.bz2 tar xjf uriparser-0.6.0.tar.bz2 cd uriparser-0.6.0 ./configure --host=arm-angstrom-linux-gnueabi \ --prefix=/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr make make install Codice:
cd olsrD ./configure --host=arm-angstrom-linux-gnueabi \ --prefix=/usr/local/openmoko/arm/arm-angstrom-linux-gnueabi/usr ...e non ho idea di come crearlo... ![]() |
![]() |
![]() |
![]() |
#8 |
Member
Iscritto dal: Apr 2007
Città: calafrica
Messaggi: 196
|
|
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 09:58.