UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer zfima
Observer
8,042 Views
Registered: ‎01-06-2010

error: lwip/sockets.h: No such file or directory

Jump to solution

In xps i make bsp with ethernet interrupt, move it to SDK. In SDK add LwIP, so i get a lot of LwIP headers. But next simple code make error:

 

#include "lwip/sockets.h"

int main()
{
	int i = AF_INET;
	return 0;
}

 

 

error:

 

**** Build of configuration Debug for project empty_cpp_0 ****

make all 
Building file: ../src/main.cc
Invoking: MicroBlaze g++ compiler
mb-g++ -Wall -O0 -g3 -c -fmessage-length=0 -mxl-soft-mul -MMD -MP -MF"src/main.d" -MT"src/main.d" -o"src/main.o" "../src/main.cc"
../src/main.cc:4:26: error: lwip/sockets.h: No such file or directory
../src/main.cc: In function ‘int main()’:
../src/main.cc:8: error: ‘AF_INET’ was not declared in this scope
../src/main.cc:8: warning: unused variable ‘i’
make: *** [src/main.o] Error 1

 Where is catch???

When i point on "lwip/sockets.h" and press F3 button, i can see the header file. I miss some paths?

 

0 Kudos
1 Solution

Accepted Solutions
Adventurer
Adventurer
10,465 Views
Registered: ‎04-09-2010

Re: error: lwip/sockets.h: No such file or directory

Jump to solution

Hi,

 

1. In software platform settings, make sure that you have included 'lwip' library.

 

2. If it has been included, then make sure that, in OS and library settings, in under 'lwip' library, you have set SOCKET API, as by default it is RAW API

View solution in original post

6 Replies
Adventurer
Adventurer
10,466 Views
Registered: ‎04-09-2010

Re: error: lwip/sockets.h: No such file or directory

Jump to solution

Hi,

 

1. In software platform settings, make sure that you have included 'lwip' library.

 

2. If it has been included, then make sure that, in OS and library settings, in under 'lwip' library, you have set SOCKET API, as by default it is RAW API

View solution in original post

Observer zfima
Observer
8,031 Views
Registered: ‎01-06-2010

Re: error: lwip/sockets.h: No such file or directory

Jump to solution

Thank you!!!

2 works

0 Kudos
Observer zfima
Observer
8,028 Views
Registered: ‎01-06-2010

Re: error: lwip/sockets.h: No such file or directory

Jump to solution

My troubles continues....

 

Next code pass building, but fail on linking:

 

#include "lwip/init.h"
#include "lwip/sockets.h"
#include <stdio.h>
#include <string.h>
#include "lwip/inet.h"
#include "lwip/sys.h"
#include "lwipopts.h"
u16_t ECHO_PORT = 7;

int main()
{
	int sock, new_sd;
	struct sockaddr_in address, remote;
	int size;

	if ((sock = lwip_socket(AF_INET, SOCK_STREAM, 0)) < 0){
		return 0;
	}

	address.sin_family = AF_INET;
	address.sin_port = htons(ECHO_PORT);
	address.sin_addr.s_addr = INADDR_ANY;

	if (lwip_bind(sock, (struct sockaddr *)&address, sizeof (address)) < 0){
		return 0;
	}

	lwip_listen(sock, 5);

	return 0;
}

 

Error:

 

**** Build of configuration Debug for project empty_cpp_0 ****

make all 
Building file: ../src/main.cc
Invoking: MicroBlaze g++ compiler
mb-g++ -Wall -O0 -g3 -c -fmessage-length=0 -D __XMK__ -I../../xilkernel_bsp_LwIP/microblaze_0/include -mxl-pattern-compare -mcpu=v7.30.a -mno-xl-soft-mul -MMD -MP -MF"src/main.d" -MT"src/main.d" -o"src/main.o" "../src/main.cc"
../src/main.cc: In function ‘int main()’:
../src/main.cc:12: warning: unused variable ‘new_sd’
../src/main.cc:13: warning: unused variable ‘remote’
../src/main.cc:14: warning: unused variable ‘size’
Finished building: ../src/main.cc
 
Building target: empty_cpp_0.elf
Invoking: MicroBlaze g++ linker
mb-g++ -L../../xilkernel_bsp_LwIP/microblaze_0/lib -mxl-pattern-compare -mcpu=v7.30.a -mno-xl-soft-mul -o"empty_cpp_0.elf"  ./src/main.o   -lxilkernel -llwip4
../../xilkernel_bsp_LwIP/microblaze_0/lib/liblwip4.a(sys_arch.o): In function `sys_mbox_post':
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:247: undefined reference to `sem_wait'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:266: undefined reference to `sem_post'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:269: undefined reference to `sem_post'
../../xilkernel_bsp_LwIP/microblaze_0/lib/liblwip4.a(sys_arch.o): In function `sys_sem_signal':
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:164: undefined reference to `sem_post'
../../xilkernel_bsp_LwIP/microblaze_0/lib/liblwip4.a(sys_arch.o): In function `sys_arch_mbox_fetch':
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:306: undefined reference to `sem_wait'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:314: undefined reference to `xget_clock_ticks'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:327: undefined reference to `sem_wait'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:314: undefined reference to `sem_post'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:319: undefined reference to `xget_clock_ticks'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:324: undefined reference to `sem_timedwait'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:342: undefined reference to `sem_post'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:353: undefined reference to `sem_wait'
../../xilkernel_bsp_LwIP/microblaze_0/lib/liblwip4.a(sys_arch.o): In function `sys_arch_sem_wait':
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:140: undefined reference to `xget_clock_ticks'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:143: undefined reference to `sem_timedwait'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:160: undefined reference to `xget_clock_ticks'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:150: undefined reference to `sem_wait'
../../xilkernel_bsp_LwIP/microblaze_0/lib/liblwip4.a(sys_arch.o): In function `sys_mbox_trypost':
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:276: undefined reference to `sem_trywait'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:294: undefined reference to `sem_post'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:297: undefined reference to `sem_post'
../../xilkernel_bsp_LwIP/microblaze_0/lib/liblwip4.a(sys_arch.o): In function `sys_mbox_free':
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:236: undefined reference to `sem_wait'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:238: undefined reference to `sem_destroy'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:239: undefined reference to `sem_destroy'
../../xilkernel_bsp_LwIP/microblaze_0/lib/liblwip4.a(sys_arch.o): In function `sys_sem_free':
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:173: undefined reference to `sem_destroy'
../../xilkernel_bsp_LwIP/microblaze_0/lib/liblwip4.a(sys_arch.o): In function `sys_mbox_new':
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:204: undefined reference to `sem_init'
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:213: undefined reference to `sem_init'
../../xilkernel_bsp_LwIP/microblaze_0/lib/liblwip4.a(sys_arch.o): In function `sys_sem_new':
/cygdrive/d/Temp/Vertex/XPS/Temp12_LwIP/SDK/SDK_Workspace_35/xilkernel_bsp_LwIP/microblaze_0/libsrc/lwip130_v2_00_a/src/contrib/ports/xilinx/sys_arch.c:118: undefined reference to `sem_init'
collect2: ld returned 1 exit status
make: *** [empty_cpp_0.elf] Error 1

 

 

i try add something to linker in options, like dir path or library but it not help....

please, help me

 

0 Kudos
Adventurer
Adventurer
8,012 Views
Registered: ‎04-09-2010

Re: error: lwip/sockets.h: No such file or directory

Jump to solution

Check under OS and Lib configuration that you have taken config_sema = TRUE, and in systtmr_dev = xps_timer (in systmr_spec).

Adventurer
Adventurer
8,011 Views
Registered: ‎04-09-2010

Re: error: lwip/sockets.h: No such file or directory

Jump to solution

also check that config_time = TRUE

Observer zfima
Observer
8,004 Views
Registered: ‎01-06-2010

Re: error: lwip/sockets.h: No such file or directory

Jump to solution
Thanks a lot!!!! U R great!!!
0 Kudos