[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] LwIP issue: "undefined reference".
From: |
DaMunky89 |
Subject: |
[lwip-users] LwIP issue: "undefined reference". |
Date: |
Fri, 14 Jan 2011 12:01:57 -0800 (PST) |
Hi, I'm working on a project for school that will be using lwIP, and I need
to familiarize myself with how it works. For now I'm just trying to write a
simple test program. It doesn't even do anything yet, but I cannot for the
life of me get it to compile:
#include "lwip\udp.h"
void udp_packet_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct
ip_addr *addr, u16_t port);
main(){
// Create a new pcb.
struct udp_pcb * pcb;
pcb = udp_new();
if (pcb == NULL)
return -1;
// Bind to any IP on port 60,000.
if (udp_bind(pcb, IP_ADDR_ANY, 60000) != ERR_OK)
return -2;
// On datagram receipt, call udp_packet_recv.
udp_recv(pcb, udp_packet_recv, NULL);
}
void udp_packet_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct
ip_addr *addr, u16_t port){
if (p != NULL){
// TODO: Case handling GET packet.
// TODO: Case handling data receipt.
pbuf_free(p); // Free pbuf when finished.
}
}
Every time I try to compile this, I get the following errors:
C:\Users\ZACHAR~1\AppData\Local\Temp\cc1kZ7BP.o:client.c:(.text+0xf):
undefined reference to `udp_new()'
C:\Users\ZACHAR~1\AppData\Local\Temp\cc1kZ7BP.o:client.c:(.text+0x3d):
undefined reference to `udp_bind(udp_pcb*, ip_addr*, unsigned short)'
C:\Users\ZACHAR~1\AppData\Local\Temp\cc1kZ7BP.o:client.c:(.text+0x5d):
undefined reference to `udp_packet_recv(void*, udp_pcb*, pbuf*, ip_addr*,
unsigned short)'
C:\Users\ZACHAR~1\AppData\Local\Temp\cc1kZ7BP.o:client.c:(.text+0x69):
undefined reference to `udp_recv(udp_pcb*, void (*)(void*, udp_pcb*, pbuf*,
ip_addr*, unsigned short), void*)'
C:\Users\ZACHAR~1\AppData\Local\Temp\cc1kZ7BP.o:client.c:(.text+0x8e):
undefined reference to `pbuf_free(pbuf*)'
collect2: ld returned 1 exit status
I read something online about linking "lwip4", but have not been able to
find anything about that file elsewhere. (I can't even figure out where I
originally read that...) I believe I've included all the requisite files!
http://old.nabble.com/file/p30674968/files.png
I'm using "lwip-win32-msvc-0.1", which is based on the CVS version of lwIP
from 23-01-2002. It is available for download here:
http://ishare.iask.sina.com.cn/f/5245596.html
The computer I am attempting to compile on is a Sony VPCF126FM, with no
hardware modifications of any kind:
www.docs.sony.com/release/specs/VPCF126FMB_mksp.pdf
I'm using MiniGW command line " g++ client.c -o client.exe" to compile.
(Nothing fancy.)
Can anybody help me out here? This has become a real sticking point.
--
View this message in context:
http://old.nabble.com/LwIP-issue%3A-%22undefined-reference%22.-tp30674968p30674968.html
Sent from the lwip-users mailing list archive at Nabble.com.
- [lwip-users] LwIP issue: "undefined reference".,
DaMunky89 <=