Re: Building libcurl 7.57 on Windows

2018-02-05 Thread Alex Chen
Thanks for the information Ray, I finally got the library built on Windows 
using the MakefileBuild.vc.  But I have to path MakefileBuild.vc so that I can 
download the source tar ball, apply the patch, and proceed with the build 
without manual tweaking.

It would be nice if libcurl can take the following changes in MakefileBuild.vc 
for future releases. 

1. 

!IF "$(VC)"=="6"

CC_NODEBUG  = $(CC) /O2 /DNDEBUG

CC_DEBUG= $(CC) /Od /Gm /Zi /D_DEBUG /GZ 

CFLAGS  = /I. /I../lib /I../include /nologo /W4 /wd4127 /GX /DWIN32 /YX /FD 
/c /DBUILDING_LIBCURL $(CFLAGSZLIB) ß Add CFLAGSZLIB macro to CFLAGS so 
I can define ’CFLAGSZLIB=/DZLIB_WINAPI’ in command line parameters to ’nmake’

!ELSE

CC_NODEBUG  = $(CC) /O2 /DNDEBUG

CC_DEBUG= $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd

CFLAGS  = /I. /I ../lib /I../include /nologo /W4 /wd4127 /EHsc /DWIN32 /FD 
/c /DBUILDING_LIBCURL $(CFLAGSZLIB)

!ENDIF

 

 

2. 

!IF "$(WITH_ZLIB)"=="dll"

!IFNDEF ZLIB_LIBS    ß---  This check allows 
users to override ZLIB_LIBS with their definition of zlibwapi.lib.

ZLIB_LIBS   = zlib.lib

!ENDIF

USE_ZLIB= true

ZLIB= dll 

!ELSEIF "$(WITH_ZLIB)"=="static"

ZLIB_LIBS   = zlib_a.lib

USE_ZLIB= true

ZLIB= static

!ENDIF

 

 

Thanks for the help.

 

Alex Chen

From: Ray Satiro 
Date: Friday, February 2, 2018 at 1:04 PM
To: Alex Chen , libcurl development 

Subject: Re: Building libcurl 7.57 on Windows

 

On 2/2/2018 3:03 PM, Alex Chen wrote:


version.obj : error LNK2019: unresolved external symbol _zlibVersion referenced 
in function _curl_version

content_encoding.obj : error LNK2001: unresolved external symbol _zlibVersion

content_encoding.obj : error LNK2019: unresolved external symbol _inflate 
referenced in function _inflate_stream

content_encoding.obj : error LNK2019: unresolved external symbol _inflateEnd 
referenced in function _exit_zlib

content_encoding.obj : error LNK2019: unresolved external symbol _inflateInit_ 
referenced in function _inflate_stream

content_encoding.obj : error LNK2019: unresolved external symbol _inflateInit2_ 
referenced in function _inflate_stream

..\builds\libcurl-vc14-x86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi-obj-lib\libcurl_debug.dll
 : fatal error LNK1120: 5 unresolved externals

I have been using the same zlibwapi library to build libcurl in 7.38.0, 7.44.0 
and 7.51.0.  

 

Maybe the compiler/linker flags have been changed or previous version that uses 
specific make file, e.g. curl-7.51.0\lib\Makefile.vc14, has different settings?


IIRC zlibwapi is stdcall and requires ZLIB_WINAPI to be defined, otherwise the 
header is going to include cdecl prototypes.


---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Re: Building libcurl 7.57 on Windows

2018-02-02 Thread Ray Satiro
On 2/2/2018 3:03 PM, Alex Chen wrote:
>
> version.obj : error LNK2019: unresolved external symbol _zlibVersion
> referenced in function _curl_version
>
> content_encoding.obj : error LNK2001: unresolved external symbol
> _zlibVersion
>
> content_encoding.obj : error LNK2019: unresolved external symbol
> _inflate referenced in function _inflate_stream
>
> content_encoding.obj : error LNK2019: unresolved external symbol
> _inflateEnd referenced in function _exit_zlib
>
> content_encoding.obj : error LNK2019: unresolved external symbol
> _inflateInit_ referenced in function _inflate_stream
>
> content_encoding.obj : error LNK2019: unresolved external symbol
> _inflateInit2_ referenced in function _inflate_stream
>
> ..\builds\libcurl-vc14-x86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi-obj-lib\libcurl_debug.dll
> : fatal error LNK1120: 5 unresolved externals
>
> I have been using the same zlibwapi library to build libcurl in
> 7.38.0, 7.44.0 and 7.51.0. 
>
>  
>
> Maybe the compiler/linker flags have been changed or previous version
> that uses specific make file, e.g. curl-7.51.0\lib\Makefile.vc14, has
> different settings?
>

IIRC zlibwapi is stdcall and requires ZLIB_WINAPI to be defined,
otherwise the header is going to include cdecl prototypes.
---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Re: Building libcurl 7.57 on Windows

2018-02-02 Thread Alex Chen
Those unresolved symbol errors come from content_encoding.c. They are 
referenced in older versions, e.g. 7.51.0, where they linked with the same 
zlibwapi without problems.

 

Alex Chen

From: curl-library  on behalf of Alex Chen 

Reply-To: libcurl development 
Date: Friday, February 2, 2018 at 12:07 PM
To: libcurl development 
Subject: Re: Building libcurl 7.57 on Windows

 

I tried the following approaches and none of them worked. (The OpenSSL and Zlib 
libraries are located under \Prebiuilt\[Debug | Release] ) 

· Set the ZLIB_LIBS environment variable

SET ZLIB_LIBS=zlibwapi.lib

NMAKE /E /F Makefile.vc VC=14 WITH_SSL=dll WITH_ZLIB=dll ENABLE_IPV6=yes 
GEN_PDB=yes MODE=dll MACHINE=x86 WITH_DEVEL=D:\Prebuilt\Debug DEBUG=yes

· 2. Define ZLIB_LIBS directly in the command line

NMAKE ZLIB_LIBS=zlibwapi.lib /F Makefile.vc VC=14 WITH_SSL=dll WITH_ZLIB=dll 
ENABLE_IPV6=yes GEN_PDB=yes MODE=dll MACHINE=x86 WITH_DEVEL=D:\Prebuilt\Debug 
DEBUG=yes

 

I got the following errors in both cases:

LINK : fatal error LNK1181: cannot open input file 'zlib.lib'

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 
14.0\VC\BIN\x86_amd64\link.exe"' : return code '0x49d'

 

I finally gave up and changed ZLIB_LIBS macro in MakefileBuild.vc directly.  It 
compiled fine but I got a different error:

….

Copyright (C) Microsoft Corporation.  All rights reserved.

Using SSL: true

Using NGHTTP2: false

Using c-ares:

Using SSH2:

Using ZLIB: true

Using IDN: true

Using IPv6: true

Using SSPI: true

Using WinSSL: false

CFLAGS: /I. /I ../lib /I../include /nologo /W4 /wd4127 /EHsc /DWIN32 /FD /c 
/DBUILDING_LIBCURL /ID:\Prebuilt\Debug/include /DUSE_OPENSSL 
/ID:\Prebuilt\Debug/include/openssl /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ 
/DUSE_WIN32_IDN /DWANT_IDN_PROTOTYPES /DUSE_IPV6 /DUSE_WINDOWS_SSPI /Zi 
/Fd..\builds\libcurl-vc14-x86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi-obj-lib\libcurl_debug.pdb

LFLAGS: /nologo /machine:x86 /LIBPATH:D:\Prebuilt\Debug/lib libeay32.lib 
ssleay32.lib zlibwapi.lib /incremental:no /opt:ref,icf

GenPDB: true

Debug: yes

Machine: x86

link.exe /DLL ws2_32.lib wldap32.lib advapi32.lib Normaliz.lib 
/out:..\builds\libcurl-vc14-x86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi-obj-lib\libcurl_debug.dll
 /DEBUG 
/IMPLIB:..\builds\libcurl-vc14-x86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi-obj-lib\libcurl_debug.lib
 /nologo /machine:x86 "/LIBPATH:D:\Prebuilt\Debug/lib"  libeay32.lib 
ssleay32.lib  zlibwapi.lib /incremental:no …..

Creating library 
..\builds\libcurl-vc14-x86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi-obj-lib\libcurl_debug.lib
 and object 
..\builds\libcurl-vc14-x86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi-obj-lib\libcurl_debug.exp

version.obj : error LNK2019: unresolved external symbol _zlibVersion referenced 
in function _curl_version

content_encoding.obj : error LNK2001: unresolved external symbol _zlibVersion

content_encoding.obj : error LNK2019: unresolved external symbol _inflate 
referenced in function _inflate_stream

content_encoding.obj : error LNK2019: unresolved external symbol _inflateEnd 
referenced in function _exit_zlib

content_encoding.obj : error LNK2019: unresolved external symbol _inflateInit_ 
referenced in function _inflate_stream

content_encoding.obj : error LNK2019: unresolved external symbol _inflateInit2_ 
referenced in function _inflate_stream

..\builds\libcurl-vc14-x86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi-obj-lib\libcurl_debug.dll
 : fatal error LNK1120: 5 unresolved externals

I have been using the same zlibwapi library to build libcurl in 7.38.0, 7.44.0 
and 7.51.0.  

 

Maybe the compiler/linker flags have been changed or previous version that uses 
specific make file, e.g. curl-7.51.0\lib\Makefile.vc14, has different settings?

 

Alex Chen

 

---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Re: Building libcurl 7.57 on Windows

2018-02-02 Thread Alex Chen
I tried the following approaches and none of them worked. (The OpenSSL and Zlib 
libraries are located under \Prebiuilt\[Debug | Release] ) 
Set the ZLIB_LIBS environment variable
SET ZLIB_LIBS=zlibwapi.lib

NMAKE /E /F Makefile.vc VC=14 WITH_SSL=dll WITH_ZLIB=dll ENABLE_IPV6=yes 
GEN_PDB=yes MODE=dll MACHINE=x86 WITH_DEVEL=D:\Prebuilt\Debug DEBUG=yes
2. Define ZLIB_LIBS directly in the command line
NMAKE ZLIB_LIBS=zlibwapi.lib /F Makefile.vc VC=14 WITH_SSL=dll WITH_ZLIB=dll 
ENABLE_IPV6=yes GEN_PDB=yes MODE=dll MACHINE=x86 WITH_DEVEL=D:\Prebuilt\Debug 
DEBUG=yes

 

I got the following errors in both cases:

LINK : fatal error LNK1181: cannot open input file 'zlib.lib'

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 
14.0\VC\BIN\x86_amd64\link.exe"' : return code '0x49d'

 

I finally gave up and changed ZLIB_LIBS macro in MakefileBuild.vc directly.  It 
compiled fine but I got a different error:

….

Copyright (C) Microsoft Corporation.  All rights reserved.

Using SSL: true

Using NGHTTP2: false

Using c-ares:

Using SSH2:

Using ZLIB: true

Using IDN: true

Using IPv6: true

Using SSPI: true

Using WinSSL: false

CFLAGS: /I. /I ../lib /I../include /nologo /W4 /wd4127 /EHsc /DWIN32 /FD /c 
/DBUILDING_LIBCURL /ID:\Prebuilt\Debug/include /DUSE_OPENSSL 
/ID:\Prebuilt\Debug/include/openssl /DHAVE_ZLIB_H /DHAVE_ZLIB /DHAVE_LIBZ 
/DUSE_WIN32_IDN /DWANT_IDN_PROTOTYPES /DUSE_IPV6 /DUSE_WINDOWS_SSPI /Zi 
/Fd..\builds\libcurl-vc14-x86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi-obj-lib\libcurl_debug.pdb

LFLAGS: /nologo /machine:x86 /LIBPATH:D:\Prebuilt\Debug/lib libeay32.lib 
ssleay32.lib zlibwapi.lib /incremental:no /opt:ref,icf

GenPDB: true

Debug: yes

Machine: x86

    link.exe /DLL ws2_32.lib wldap32.lib advapi32.lib Normaliz.lib 
/out:..\builds\libcurl-vc14-x86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi-obj-lib\libcurl_debug.dll
 /DEBUG 
/IMPLIB:..\builds\libcurl-vc14-x86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi-obj-lib\libcurl_debug.lib
 /nologo /machine:x86 "/LIBPATH:D:\Prebuilt\Debug/lib"  libeay32.lib 
ssleay32.lib  zlibwapi.lib /incremental:no …..

Creating library 
..\builds\libcurl-vc14-x86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi-obj-lib\libcurl_debug.lib
 and object 
..\builds\libcurl-vc14-x86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi-obj-lib\libcurl_debug.exp

version.obj : error LNK2019: unresolved external symbol _zlibVersion referenced 
in function _curl_version

content_encoding.obj : error LNK2001: unresolved external symbol _zlibVersion

content_encoding.obj : error LNK2019: unresolved external symbol _inflate 
referenced in function _inflate_stream

content_encoding.obj : error LNK2019: unresolved external symbol _inflateEnd 
referenced in function _exit_zlib

content_encoding.obj : error LNK2019: unresolved external symbol _inflateInit_ 
referenced in function _inflate_stream

content_encoding.obj : error LNK2019: unresolved external symbol _inflateInit2_ 
referenced in function _inflate_stream

..\builds\libcurl-vc14-x86-debug-dll-ssl-dll-zlib-dll-ipv6-sspi-obj-lib\libcurl_debug.dll
 : fatal error LNK1120: 5 unresolved externals

I have been using the same zlibwapi library to build libcurl in 7.38.0, 7.44.0 
and 7.51.0.  

 

Maybe the compiler/linker flags have been changed or previous version that uses 
specific make file, e.g. curl-7.51.0\lib\Makefile.vc14, has different settings?

 

Alex Chen

From: curl-library  on behalf of Ray Satiro 
via curl-library 
Reply-To: libcurl development 
Date: Friday, January 12, 2018 at 9:10 PM
To: 
Cc: Ray Satiro 
Subject: Re: Building libcurl 7.57 on Windows

 

On 1/12/2018 8:03 PM, Alex Chen via curl-library wrote:


   I recently downloaded libcurl 7.57 and tried to build it on Windows but 
failed.  I was able to build 7.51 on Windows without problem.

The major change is that the file curl-7.51.0/lib/Makefile.vc14 is gone from 
curl-7.57-0/lib.  My build script used to call ‘nmake’ with that make file as 
input.

Since that file is gone, the build script cannot continue.

 

I notice there seems to be stuff for ‘cmake’.  What is the correct process to 
build libcurl 7.57 on Windows now?


I think what you are referring to was retired in favor of the vc makefiles in 
the winbuild folder. Check the README, from the VS command prompt it will be 
something like nmake /f Makefile.vc mode=dll VC=10

Alternatively there's pregenerated Visual Studio project files in the projects 
folder, in some common configurations. And cmake. And autotools (./configure && 
make). So there are at least 4 ways to build for Windows still.

--- 
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: 
https://curl.haxx.se/mail/etiquette.html 

---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Re: Building libcurl 7.57 on Windows

2018-01-12 Thread Ray Satiro via curl-library
On 1/12/2018 8:03 PM, Alex Chen via curl-library wrote:
>
>    I recently downloaded libcurl 7.57 and tried to build it on Windows
> but failed.  I was able to build 7.51 on Windows without problem.
>
> The major change is that the file curl-7.51.0/lib/Makefile.vc14 is
> gone from curl-7.57-0/lib.  My build script used to call ‘nmake’ with
> that make file as input.
>
> Since that file is gone, the build script cannot continue.
>
>  
>
> I notice there seems to be stuff for ‘cmake’.  What is the correct
> process to build libcurl 7.57 on Windows now?
>

I think what you are referring to was retired in favor of the vc
makefiles in the winbuild folder. Check the README, from the VS command
prompt it will be something like nmake /f Makefile.vc mode=dll VC=10

Alternatively there's pregenerated Visual Studio project files in the
projects folder, in some common configurations. And cmake. And autotools
(./configure && make). So there are at least 4 ways to build for Windows
still.

---
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html