This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Cygwin and C socket


Hello, I am trying to build a PoC around calling a RESTFul service from a C
program. I have installed the eclipse CDT and Cygwin and can build and run a
hello world C exe.

The next test is to use the socket stuff to connect to a URL, however whe I
try to compile my code (taken from another site) I get an error that the
compiler does not know the size of an object. I can not finr the addrinfo
struct in any of the include below. Is there a specific package I need to
install to make this work?

Thanks



the code in question:

#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>


int main(int argc, char *argv[]) {


	struct addrinfo hints, *res, *p;
......
	
	if ((status = getaddrinfo(argv[1], NULL, &hints, &res)) != 0) {
-- 
View this message in context: http://www.nabble.com/Cygwin-and-C-socket-tp24221636p24221636.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]