Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
754 Views

Issue in Simple Client in Nios2

Hi, 

 

I am having the simple client in nios2 program which is using the winsock2.h header. 

Have included the all w32api files to the project. ( Attached is the client program). 

When I try to compile it, its showing me an error in winnt.h and winbase.h files. Below are the error: 

 

/client_bsp/winnt.h:2350:2: error:# error "undefined processor type" 

In file included from ../client_bsp/windef.h:253, 

from ../client_bsp/windows.h:48, 

from ../client_bsp/winsock2.h:22, 

from hello_world.c:2: 

../client_bsp/winnt.h:2352: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token 

../client_bsp/winnt.h:2363: error: expected specifier-qualifier-list before 'PCONTEXT' 

 

I believe, I might be missing some files hence the error. 

 

Could you please assist me in this. 

 

Thanks, 

Subbu
0 Kudos
3 Replies
Highlighted
Valued Contributor III
2 Views

You can't use winsock or win32 API on a Nios 2 application, they are only available on Windows. You should use standard BSD sockets instead.

0 Kudos
Highlighted
Valued Contributor III
2 Views

Ok Can I get a client program for the nios2. The demo which altera gave is server.

0 Kudos
Highlighted
Valued Contributor III
2 Views

The BSD socket is widely documented. For example you can find here (http://en.wikipedia.org/wiki/bsd_socket) examples for both servers and clients, on both UDP and TCP.

0 Kudos