curl-library
Re: Compiling under windows with USE_IDN=yes, patch needed
Date: Sat, 28 Jul 2012 10:14:25 +0200
Guenter in gmane.comp.web.curl.library (Sat, 28 Jul 2012 06:24:57
+0200):
>Am 28.07.2012 06:13, schrieb Guenter:
>> it might happen that at some point MinGW and OpenWatcom add these
>> protos to their APIs which would then produce a redefine ..., sigh
>> ok, for now your suggestion seems to be the simplest way to fix ...
>damn, it happened already at least for MinGW64 which has them in
>winnls.h ....
>
>would be great if you could try if adding winnls.h instead of defining
>WANT_IDN_PROTOTYPES fixes it too, and if that compiles cleanly with MSVC ...
Short answer: winnls.h is already included in the compilation.
And now for the long answer.
I commented out the four lines starting with #ifdef WANT_IDN_PROTOTYPES
in idn_win32.src and added the line #include <winnls.h> at the same
place. Result: the unresolved symbols are back again. Using both
#include <winnls.h> and the WANT_IDN_PROTOTYPES lines compiles OK.
Searching on my system for winnls.h returned no less than 11 instances
of it. 9 versions in one of the many MS SDK's and two in MingW and
MingW64.
Current include-path in the X86 VC9 prompt:
INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\ATLMFC\INCLUDE;
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE;
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include;
The compiler uses the first (and only) one it can find, which is the one
in C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\. I tried to
include the winnls.h from MingW and MingW64, but that lead to all kind
of other errors.
It was then, that I discovered that winnls.h was already included in the
compilation! Probable cause:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\Windows.h
Line 160: #include <winnls.h>
So sticking with the four #ifdef WANT_IDN_PROTOTYPES lines is the best
option, I guess.
Jan
C:\php-sdk\curl-src\winbuild>dir \winnls.h /s
Volume in drive C is Windows7_OS
Volume Serial Number is A6DB-07E9
Directory of C:\MinGW\include
26/03/11 04:46 24.777 winnls.h
1 File(s) 24.777 bytes
Directory of C:\MinGW64\mingw\include
22/02/11 14:14 35.928 winnls.h
1 File(s) 35.928 bytes
Directory of C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include
27/09/07 15:19 86.946 WinNls.h
1 File(s) 86.946 bytes
Directory of C:\Program Files\Microsoft SDKs\Windows\v7.1\Include
19/04/10 20:44 95.911 WinNls.h
1 File(s) 95.911 bytes
Directory of C:\Program Files (x86)\Microsoft SDKs\Windows\v5.0\Include
03/03/06 23:23 60.362 WinNls.h
1 File(s) 60.362 bytes
Directory of C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include
30/09/09 20:27 95.911 WinNls.h
1 File(s) 95.911 bytes
Directory of C:\Program Files (x86)\Microsoft Visual Studio\VC98\Include
24/04/98 01:00 48.337 WINNLS.H
1 File(s) 48.337 bytes
Directory of C:\Program Files (x86)\Microsoft Visual Studio
9.0\SmartDevices\SDK\PocketPC2003\Include
06/04/03 11:53 53.127 winnls.h
1 File(s) 53.127 bytes
Directory of C:\Program Files (x86)\Microsoft Visual Studio
9.0\SmartDevices\SDK\Smartphone2003\Include
06/05/03 18:34 53.127 winnls.h
1 File(s) 53.127 bytes
Directory of C:\Program Files (x86)\Windows Mobile 5.0 SDK
R2\PocketPC\Include\Armv4i
20/02/07 18:00 53.623 winnls.h
1 File(s) 53.623 bytes
Directory of C:\Program Files (x86)\Windows Mobile 5.0 SDK
R2\Smartphone\Include\Armv4i
20/02/07 18:00 53.623 winnls.h
1 File(s) 53.623 bytes
Total Files Listed:
11 File(s) 661.672 bytes
0 Dir(s) 20.030.726.144 bytes free
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-07-28