| 143 | |
| 144 | == Why Visual C++ 8.0 fails with C2894 error in wspiapi.h when building GDAL with libcurl support? == |
| 145 | |
| 146 | Here is the complete error message of this issue: |
| 147 | {{{ |
| 148 | C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\wspiapi.h(44) : |
| 149 | error C2894: templates cannot be declared to have 'C' linkage |
| 150 | }}} |
| 151 | |
| 152 | This is a [http://curl.haxx.se/mail/tracker-2007-11/0027.html known bug] in the wspiapi.h header. One of possible solutions is to manually patch ''curl.h'' replacing lines '''153 - 154''' with the following code: |
| 153 | |
| 154 | {{{ |
| 155 | #ifdef __cplusplus |
| 156 | } |
| 157 | #endif |
| 158 | #include <winsock2.h> |
| 159 | #include <ws2tcpip.h> |
| 160 | #ifdef __cplusplus |
| 161 | extern "C" { |
| 162 | #endif |
| 163 | }}} |
| 164 | |
| 165 | This problem occurs in [http://curl.haxx.se/libcurl/ libcurl] <= 7.17.1. Perhaps, later versions of libcurl will include this fix. |