curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Building libcurl 7.57 on Windows

From: Alex Chen <alex_chen_at_filemaker.com>
Date: Mon, 05 Feb 2018 10:32:37 -0800

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 <raysatiro_at_yahoo.com>
Date: Friday, February 2, 2018 at 1:04 PM
To: Alex Chen <alex_chen_at_filemaker.com>, libcurl development <curl-library_at_cool.haxx.se>
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
Received on 2018-02-05