-->
Page 2 of 2

Re: TCP Server Setup

PostPosted: Mon Nov 10, 2014 7:50 pm
by cyborgmax
I'm trying to compile your example, but I can't get it to compile, it looks like I need to declare more functions(like putcconn), but where? in a different file or do I need another library besides the one you stated before??
Hope you or someone can help me?
Thanks a lot.

CC driver/adc.c
CC driver/gpio16.c
CC driver/i2c_master.c
CC driver/key.c
CC driver/pwm.c
CC driver/spi_master.c
CC driver/uart.c
CC user/user_main.c
In file included from include/lwip/arch.h:43:0,
from include/lwip/debug.h:35,
from include/lwip/opt.h:46,
from include/lwip/stats.h:35,
from user/user_main.c:6:
include/arch/cc.h:46:0: error: "BYTE_ORDER" redefined [-Werror]
#define BYTE_ORDER LITTLE_ENDIAN
^
In file included from /usr/include/bits/string2.h:51:0,
from /usr/include/string.h:635,
from /opt/Espressif/ESP8266_SDK/include/osapi.h:8,
from user/user_main.c:3:
/usr/include/endian.h:48:0: note: this is the location of the previous definition
# define BYTE_ORDER __BYTE_ORDER
^
user/user_main.c: In function 'tcpserver_connectcb':
user/user_main.c:47:5: error: 'putcconn' undeclared (first use in this function)
putcconn = pespconn;
^
user/user_main.c:47:5: note: each undeclared identifier is reported only once for each function it appears in
user/user_main.c:48:30: error: 'tcp_putc' undeclared (first use in this function)
os_install_putc2((void *)tcp_putc);
^
cc1: all warnings being treated as errors
make: *** [build/user/user_main.o] Error 1

Re: TCP Server Setup

PostPosted: Tue Nov 11, 2014 4:52 am
by 0ff
Sorry, this is code taken from a bigger library, I forgot to throw out these two lines.
See my original post for an updated version of the code.

Edit: You need to fix your build environment first, you should never include things in /usr/include/, these are files for your build machine, rather than the esp.

Re: TCP Server Setup

PostPosted: Tue Nov 11, 2014 10:40 am
by cyborgmax
Thanks for replying, I will take a look at your code.