2

I'm in the process of converting 32bit project to x64. In most cases it just means appending 64 to library paths (and eventually building those libraries for x64). Now I assume all libraries are already ready and the code is also x64 compatible. But I keep getting errors for boost zlib library, like these:

error LNK2019: unresolved external symbol inflateEnd
error LNK2019: unresolved external symbol inflate
error LNK2019: unresolved external symbol inflateInit_
error LNK2019: unresolved external symbol deflateEnd
error LNK2019: unresolved external symbol deflate
error LNK2001: unresolved external symbol "int const boost::iostreams::zlib::default_compression"
error LNK2001: unresolved external symbol "int const boost::iostreams::zlib::deflated"
error LNK2001: unresolved external symbol "int const boost::iostreams::zlib::default_strategy"

I enabled verbose mode for linker (in MS Visual Studio you do this by adding /VERBOSE:LIB to additional linker options). Thanks to that, I can see this output line:

Searching .\..\..\libs\boost145\stage\lib64\libboost_zlib-vc100-mt-gd-1_45.lib

That would imply that the library was found in the boost145\stage\lib64. So what should I be looking for now?

One strange thing is that file that defines the first group of missing symbols (those that are not within boost) has header files within the project, zlib.h and zconf.h. Maybe this is some hint? The zlib.h defines external symbols as:

ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));

Obvious question is: where the hell is lib file for this header file?

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778

1 Answers1

1

I had the same issue, to resolve the errors I download the source from zlib and built the x64 dlls/libs locally. There were a couple issues with solution file downloaded, fixes are described below.

Zlib 1.2.8 source code: http://zlib.net/zlib128.zip

Solution File for VS2012 is located at: zlib-1.2.8\contrib\vstudio\vc11\zlibvc.sln

Fixes:

  1. Change: <Command>cd ..\..\..\contrib\masmx64 bld_ml64.bat</Command>

    to: <Command>cd ..\..\contrib\masmx64 bld_ml64.bat</Command>

  2. In zlibvc project properties -> Linker -> Advanced -> Image Has Safe Exception Handlers -> set to No (/SAFESEH:NO). Info about SAFESEH: Compiling libffi with VS2012 fails with fatal error LNK1281: Unable to generate SAFESEH image

Community
  • 1
  • 1
molafson
  • 119
  • 1
  • 4