cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1824894 ] Recent addition of ws2tcpip.h to curl.h breaks C++ apps

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Fri, 02 Nov 2007 14:18:45 -0700

Bugs item #1824894, was opened at 2007-11-02 17:18
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1824894&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: compile or build problem
Group: portability problem
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Scott Cantor (scantor)
Assigned to: Daniel Stenberg (bagder)
Summary: Recent addition of ws2tcpip.h to curl.h breaks C++ apps

Initial Comment:
Bit of a mess I think, this must have to do with the whole socklen_t mess I've run into with the older Windows compiler, but this recent addition of ws2tcpip.h to fix that issue is causing a C++ build problem with the new 7.17.1 release.

That header pulls in the Microsoft header <wspiapi.h> at the bottom of the file. That in turn includes an actual C++ template (do NOT ask me why) and because curl.h is wrapping itself in extern "C", that breaks the build with this error:

c:\program files\microsoft visual studio 8\vc\platformsdk\include\wspiapi.h(44) : error C2894: templates cannot be declared to have 'C' linkage

I think the fix for this is to stop wrapping the #includes in curl.h inside the extern "C" block. When you pull in headers, you really should refrain from assuming it's C linkage in case somebody does something like this.

You'll need to carefully wrap your own declarations in the extern "C" block, but pull in headers outside them. This will take quite a bit of testing, I suspect.

Another possibility MIGHT be to refrain from including that ws2tcpip.h header on anything other than the old VS6 compiler, but that may be more trouble, I didn't follow the socklen issue closely.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1824894&group_id=976
Received on 2007-11-02

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET