delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/08/05/15:35:38

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <4898AB50.BB90CA66@dessent.net>
Date: Tue, 05 Aug 2008 12:34:40 -0700
From: Brian Dessent <brian AT dessent DOT net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: compilation under cygwin
References: <1217938667 DOT 559f6e7cm1kogler AT edu DOT uni-klu DOT ac DOT at>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Marian Kogler wrote:

> LIBS            = -lpthread -lcurl -lcurlpp -lboost_thread-gcc-mt -lboost_regex-gcc-mt -lstdc++ -lws2_32 -lxml2 -lssl -lcrypto

-lws2_32 is a red flag.  It should not be used from a Cygwin app,
because it indicates that something is trying to use the Winsock API. 
This is not proper with Cygwin programs, which should use the POSIX
style of sockets and not the Win32 API.

> /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/winsock2.h:109: error: redefinition of `struct timeval'
> /usr/include/sys/time.h:16: error: previous definition of `struct timeval'
> /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api/winsock2.h:128: error: redefinition of `struct linger'

You're getting a bunch of errors because incluing winsock2.h causes lots
of namespace clashes.  And how could it not?  It provides a different
and incompatible set of definitions for the sockets API which is not
compatible with the standard POSIX definitions in the Cygwin headers. 
Again: the problem is that you should not attempt to use the Winsock API
from a Cygwin application.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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