delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/02/19/04:20:23

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-Id: <3.0.6.32.20020219095759.009354f0@pop3.bmlv.gv.at>
X-Sender: marek AT pop3 DOT bmlv DOT gv DOT at
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Tue, 19 Feb 2002 09:57:59 +0100
To: cygwin AT cygwin DOT com
From: "Ph. Marek" <marek AT bmlv DOT gv DOT at>
Subject: Problem compiling - unix compatible but using winsock2
Mime-Version: 1.0
X-Virus-Scanned: TAMIZ + Sophos en unizar.es

Hello everybody!

To clarify my problem reported last week:
My program lists
	#include <arpa/inet.h>
	#include <netinet/in.h>
	#include <netinet/ip.h>
	#include <netdb.h>
	#include <sys/socket.h>
	#include <sys/time.h>
	#include <sys/wait.h>
	#include <ctype.h>
	#include <fcntl.h>
	#include <math.h>
	#include <stdio.h>
	#include <stdlib.h>
	#include <string.h>
	#include <strings.h>
	#include <sys/mman.h>
	#include <sys/stat.h>
	#include <sys/types.h>
	#include <sys/uio.h>
	#include <sys/utsname.h>
	#include <sys/unistd.h>
	#include <stdarg.h>
	#include <unistd.h>
	#include <errno.h>
which works with Linux and AIX.

If I try this with cygwin it compiles, but upon call it says
	setsockopt(IP_MULTICAST_LOOP)
	errno=14 (Bad address)

The offending part is
	char c;
	c=0;
	if (setsockopt(sock, IPPROTO_IP, 
		IP_MULTICAST_LOOP, (void*)&c, sizeof(c)))
	ERROR("setsockopt(IP_MULTICAST_LOOP)");

After changing the "char" to an "int" I get
	setsockopt(IP_MULTICAST_LOOP)
	errno=109 (This option is unsupported)

Which I think after reading in some .h files
is because it uses winsock 1.1. 
As I found ws2tcpip.h I try to include that via

	#ifdef __WIN32__
	#include <w32api/ws2tcpip.h> 
	#endif

either before or after the above #include lines.
But I get a lot of "conflicting types for xxx"
in netdb.h, sys/socket.h, asm/byteorder.h, and even
	cygwin/in.h:25: parse error before '0'


Any help how to use the definitions from ws2tcpip.h?


Thank you!


Regards

Phil


-
This message is RSA-encrypted: n=33389, e=257


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019