X-Recipient: archive-cygwin@delorie.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@dessent.net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: compilation under cygwin
References: <1217938667.559f6e7cm1kogler@edu.uni-klu.ac.at>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Reply-To: cygwin@cygwin.com
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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/

