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 <curl-library-boun...@cool.haxx.se> on behalf of Alex Chen 
<alex_c...@filemaker.com>
Reply-To: libcurl development <curl-library@cool.haxx.se>
Date: Friday, February 2, 2018 at 12:07 PM
To: libcurl development <curl-library@cool.haxx.se>
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

Reply via email to