c++ - unresolved external symbol inflateEnd (and others) while using boost Zlib -


i'm in process of converting 32bit project x64. in cases means appending 64 library paths (and building libraries x64). assume libraries ready , code x64 compatible. keep getting errors boost zlib library, 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 linker (in ms visual studio adding /verbose:lib additional linker options). that, can see output line:

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

that imply library found in boost145\stage\lib64. should looking now?

one strange thing file defines first group of missing symbols (those not within boost) has header files within project, zlib.h , zconf.h. maybe hint? zlib.h defines external symbols as:

zextern int zexport inflateend of((z_streamp strm)); 

obvious question is: hell lib file header file?

i had same issue, resolve errors download source zlib , built x64 dlls/libs locally. there couple issues solution file downloaded, fixes described below.

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

solution file vs2012 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 no (/safeseh:no). info safeseh: compiling libffi vs2012 fails fatal error lnk1281: unable generate safeseh image


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -