All of your “undefined reference”
errors are to functions in the lwIP library, but I don’t see the lwIP4lib
called out on your ‘make’ line. The –L identifies the
correct path to the directory containing the library, but you need to add the “-llwip4”
to your make line. If you’re working in the XiLinx Platform Studio,
right-click on “Compiler Options”, go to the “Paths and
Options” tab and specify ‘lwip4’ in the “Libraries to
Link against” field.
From:
address@hidden
[mailto:address@hidden On Behalf Of Haori Yang
Sent: Wednesday, October 04, 2006
6:52 PM
To: Mailing
list for lwIP users
Subject: Re: [lwip-users] udp/lwip
on xilinx
Hi, Ed
do you happen to know why am I getting a lot of undefined reference?
like this? I am using EDK 8.1i
At Local date and time: Wed Oct 04 21:49:35 2006
xbash -q -c "cd /cygdrive/e/Temp/MicroDemo/WebClient2/;
/usr/bin/make -f system.make WebClient_program; exit;" started...
mb-gcc -O2 Send2PC/send.c -o WebClient/executable.elf \
-mno-xl-soft-mul -Wl,-T
-Wl,TestApp_Peripheral/src/TestApp_Peripheral_LinkScr.ld
-g -I./microblaze_0/include/
-L./microblaze_0/lib/ \
Send2PC/send.c:79:2: warning: no newline at end of file
/cygdrive/c/DOCUME~1/Haori/LOCALS~1/Temp/ccH5S4ia.o: In function `main':
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:30: undefined reference to
`mem_init'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:35: undefined reference to
`memp_init'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:36: undefined reference to
`pbuf_init'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:39: undefined reference to
`xemacif_setmac'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:44: undefined reference to
`netif_init'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:46: undefined reference to
`udp_init'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:48: undefined reference to
`mem_malloc'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:50: undefined reference to
`XEmacIf_ConfigTable'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:52: undefined reference to
`xemacif_init'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:52: undefined reference to
`ip_input'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:52: undefined reference to
`netif_add'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:60: undefined reference to
`netif_set_default'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:60: undefined reference to
`udp_new'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:64: undefined reference to
`udp_connect'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:68: undefined reference to
`pbuf_alloc'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:74: undefined reference to
`udp_send'
collect2: ld returned 1 exit status
make: *** [WebClient/executable.elf] Error 1
Done!
On 10/4/06, Pisano,
Edward A <
address@hidden> wrote:
Hello,
I just glanced at the code, but noticed that your remote_pcb
is not bound to a local endpoint. I believe both ends must be grounded
with an endpoint. Your remote_pcb uses udp_connect() to specify the
remote endpoint IP Address and port number, but isn't bound to a local IP
Address and port number.
// local_pcb = udp_new();
remote_pcb = udp_new();
// udp_bind(local_pcb, &ipaddr, (u16_t)8080);
udp_bind(remote_pcb, IP_ADDR_ANY,
(u16_t)8081);
udp_connect(remote_pcb, &remoteip,
(u16_t)8080);
Guys,
I am trying to implement a udp client on a xilinx fpga. here's my
code. I am getting "undefined reference" errors. could you take a
look at it? Thanks.
I appreciate your help.
#include "xparameters.h"
/* lwIP Includes */
#include "netif/xemacif.h"
#include "lwip/tcp.h"
#include "lwip/udp.h"
#include "lwip/memp.h"
#include "lwip/mem.h"
#include "netif/etharp.h"
#include "lwip/sys.h"
extern XEmacIf_Config XEmacIf_ConfigTable[];
int main(void)
{
struct udp_pcb *local_pcb;
struct udp_pcb *remote_pcb;
struct ip_addr ipaddr, netmask, gateway,
remoteip;
struct netif *default_netif;
char low_mac[3] = {0x00,0x22,0x38};
unsigned char fullmac[6] = {0x00, 0x0A,
0x35, 0x00, 0x22, 0x38};
unsigned char ip_address[4] =
{149,199,6,108};
unsigned char ip_remote[4] =
{149,199,6,107};
unsigned char subnet[4] = {255,255,255,0};
unsigned char gateway_addr[4] =
{149,199,6,254};
struct pbuf *p;
void *tmpPtr;
unsigned char buffer[4096] = "beetje
flauw\n";
unsigned char *buffPtr;
sys_init();
mem_init();
memp_init();
pbuf_init();
xemacif_setmac(0, (u8_t *)fullmac);
IP4_ADDR(&ipaddr, ip_address[0], ip_address[1], ip_address[2],
ip_address[3]);
IP4_ADDR(&netmask, subnet[0], subnet[1], subnet[2], subnet[3]);
IP4_ADDR(&gateway, gateway_addr[0], gateway_addr[1], gateway_addr[2],
gateway_addr[3]);
IP4_ADDR(&remoteip, ip_remote[0], ip_remote[1], ip_remote[2],
ip_remote[3]);
netif_init();
udp_init();
tmpPtr = mem_malloc((mem_size_t)sizeof(struct netif));
default_netif = (netif *) tmpPtr;
default_netif = netif_add(default_netif,
&ipaddr,
&netmask,
&gateway,
&XEmacIf_ConfigTable[0],
xemacif_init,
ip_input);
netif_set_default(default_netif);
// local_pcb = udp_new();
remote_pcb = udp_new();
// udp_bind(local_pcb, &ipaddr, (u16_t)8080);
udp_connect(remote_pcb, &remoteip, (u16_t)8080);
p = pbuf_alloc(PBUF_TRANSPORT,4096,PBUF_RAM);
p->payload = buffer;
for (;;)
{
udp_send(remote_pcb, p);
}
return 0;
}
_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users
|