VC++ Library Miss while compiling application? unzip.obj : error LNK2019 - c++

I try to compile VC++ application and get the error message as below. Is there anyone who know what the library I may be missing? Any advice & suggestion are appreciated.
My Environment:
VC++ 2010
zlib-1.2.8
boost_1_57_0
icu
1>------ Build started: Project: paloserver, Configuration: Debug Win32 ------
1> Creating library C:/Users/a992788/Virtual Machines/Documents/Application/Palo/Palo 3.x Source Code/palo-code-546/molap/server/5.1/SourceCode/Debug/paloserver.lib and object C:/Users/a992788/Virtual Machines/Documents/Application/Palo/Palo 3.x Source Code/palo-code-546/molap/server/5.1/SourceCode/Debug/paloserver.exp
1>unzip.obj : error LNK2019: unresolved external symbol _inflateInit2_ referenced in function _unzOpenCurrentFile3
1>unzip.obj : error LNK2019: unresolved external symbol _inflate referenced in function _unzReadCurrentFile
1>unzip.obj : error LNK2019: unresolved external symbol _crc32 referenced in function _unzReadCurrentFile
1>zip.obj : error LNK2001: unresolved external symbol _crc32
1>unzip.obj : error LNK2019: unresolved external symbol _inflateEnd referenced in function _unzCloseCurrentFile
1>zip.obj : error LNK2019: unresolved external symbol _get_crc_table referenced in function _zipOpenNewFileInZip4_64
1>zip.obj : error LNK2019: unresolved external symbol _deflateInit2_ referenced in function _zipOpenNewFileInZip4_64
1>zip.obj : error LNK2019: unresolved external symbol _deflate referenced in function _zipWriteInFileInZip
1>zip.obj : error LNK2019: unresolved external symbol _deflateEnd referenced in function _zipCloseFileInZipRaw64
1>C:\Users\a992788\Virtual Machines\Documents\Application\Palo\Palo 3.x Source Code\palo-code-546\molap\server\5.1\SourceCode\Debug\paloserver.dll : fatal error LNK1120: 8 unresolved externals

Add reference to the zdll.lib in your source.
#pragma comment (lib, "zdll.lib")

Related

compiling libcurl 7.61.1 from source on Windows 10

I'm working on an existing C++ project. We include libcurl as a static library, which we build from source. I'm trying to upgrade us from version 7.38.0 to version 7.61.1.
I downloaded curl-7.61.1.zip from here: https://curl.haxx.se/download/.
I made no modifications to the source and did not run any scripts that came with curl 7.61.1.
We have an existing VS solution we used for compiling curl 7.38.0, so I started from that and modified as needed for the new files in curl 7.61.1.
Everything compiled fine, however, when I try to link the compiled result into my project, I get the following errors:
1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __imp_CertOpenStore referenced in function schannel_connect_step1
1>libcurl.lib(schannel_verify.obj) : error LNK2001: unresolved external symbol __imp_CertOpenStore
1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __imp_CertCloseStore referenced in function schannel_connect_step1
1>libcurl.lib(schannel_verify.obj) : error LNK2001: unresolved external symbol __imp_CertCloseStore
1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __imp_CertFindCertificateInStore referenced in function schannel_connect_step1
1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __imp_CertFreeCertificateContext referenced in function pkp_pin_peer_pubkey
1>libcurl.lib(schannel_verify.obj) : error LNK2001: unresolved external symbol __imp_CertFreeCertificateContext
1>libcurl.lib(schannel.obj) : error LNK2019: unresolved external symbol __imp_CryptStringToBinaryA referenced in function schannel_connect_step1
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertAddCertificateContextToStore referenced in function add_certs_to_store
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertGetNameStringA referenced in function verify_host
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CryptQueryObject referenced in function add_certs_to_store
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertCreateCertificateChainEngine referenced in function verify_certificate
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertFreeCertificateChainEngine referenced in function verify_certificate
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertGetCertificateChain referenced in function verify_certificate
1>libcurl.lib(schannel_verify.obj) : error LNK2019: unresolved external symbol __imp_CertFreeCertificateChain referenced in function verify_certificate
1>C:\Users\CoffeeTableEspresso\project\win64-vs15\debug-mt\executable.exe : fatal error LNK1120: 12 unresolved externals
Has anyone run into similar issues before? Please let me know if I need to edit this with more info as well.
As Peter mentioned in a comment, I needed to link against windows libraries. In this case, linking against crypt32.lib solved the issue for me.

error LNK2019 unresolved external symbol dbbind referenced in function

I'm trying to compile tds_fdw for Windows 64bit using Visual Studio Community 2017, but I'm getting the errors below.
The C/C++ Additional Include Directories are:
E:\Downloads\FreeTDS-1.00-x86\freetds-1.00\include
C:\Apps\postgres\pgsql-10.0\include\server\port\win32_msvc
C:\Apps\postgres\pgsql-10.0\include\server\port\win32
C:\Apps\postgres\pgsql-10.0\include
C:\Apps\postgres\pgsql-10.0\include\server
E:\Workspace\git\tds_fdw\include
%(AdditionalIncludeDirectories)
The Linker Input has Additional Dependencies:
C:\Apps\postgres\pgsql-10.0\lib\postgres.lib
What am I missing?
1>------ Rebuild All started: Project: tds_fdw, Configuration: Release x64 ------
1>deparse.c
1>options.c
1>tds_fdw.c
1>Generating Code...
1> Creating library E:\Workspace\git\tds_fdw\x64\Release\tds_fdw.lib and object E:\Workspace\git\tds_fdw\x64\Release\tds_fdw.exp
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbbind referenced in function tdsGetRowCountShowPlanAll
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbclose referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcmd referenced in function tdsExecuteQuery
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcolname referenced in function tdsGetColumnMetadata
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcoltype referenced in function tdsGetColumnMetadata
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbconvert referenced in function tdsConvertToCString
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbiscount referenced in function tdsGetRowCountExecute
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcount referenced in function tdsGetRowCountExecute
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbdata referenced in function tdsIterateForeignScan
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbdatecrack referenced in function tdsDatetimeToDatum
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbdatlen referenced in function tdsIterateForeignScan
1>tds_fdw.obj : error LNK2019: unresolved external symbol dberrhandle referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbexit referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbinit referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dblogin referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbloginfree referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbmsghandle referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbnextrow referenced in function tdsGetRowCountExecute
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbnumcols referenced in function tdsGetRowCountShowPlanAll
1>tds_fdw.obj : error LNK2019: unresolved external symbol tdsdbopen referenced in function tdsSetupConnection
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbresults referenced in function tdsExecuteQuery
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbsqlexec referenced in function tdsExecuteQuery
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbuse referenced in function tdsSetupConnection
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbwillconvert referenced in function tdsConvertToCString
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbsetlname referenced in function tdsSetupConnection
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbsetlversion referenced in function tdsSetupConnection
1>E:\Workspace\git\tds_fdw\x64\Release\tds_fdw.dll : fatal error LNK1120: 26 unresolved externals
1>Done building project "tds_fdw.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Update: files from FreeTDS
freetds-1.00\bin
freetds-1.00\etc
freetds-1.00\include
freetds-1.00\lib
freetds-1.00\README.tests
freetds-1.00\sbin
freetds-1.00\var
freetds-1.00\bin\bsqldb.exe
freetds-1.00\bin\bsqlodbc.exe
freetds-1.00\bin\datacopy.exe
freetds-1.00\bin\defncopy.exe
freetds-1.00\bin\freebcp.exe
freetds-1.00\bin\osql
freetds-1.00\bin\sqsh.exe
freetds-1.00\bin\tsql.exe
freetds-1.00\etc\freetds.conf
freetds-1.00\etc\locales.conf
freetds-1.00\etc\pool.conf
freetds-1.00\include\bkpublic.h
freetds-1.00\include\cspublic.h
freetds-1.00\include\cstypes.h
freetds-1.00\include\ctpublic.h
freetds-1.00\include\odbcss.h
freetds-1.00\include\sqldb.h
freetds-1.00\include\sqlfront.h
freetds-1.00\include\sybdb.h
freetds-1.00\include\syberror.h
freetds-1.00\include\sybfront.h
freetds-1.00\include\tds_sysdep_public.h
freetds-1.00\lib\libct.a
freetds-1.00\lib\libct.la
freetds-1.00\lib\libsybdb.a
freetds-1.00\lib\libsybdb.la
freetds-1.00\lib\libtdsodbc.a
freetds-1.00\lib\libtdsodbc.la
freetds-1.00\lib\pkgconfig
freetds-1.00\lib\pkgconfig\freetds.pc
freetds-1.00\sbin\tdspool.exe
freetds-1.00\sbin\tdssrv.exe
freetds-1.00\var\log
You failed to link to the FreeTDS .lib. You'll also need to ensure the associated .dll is in your PATH or copied to the same directory as the extension you built.

Libcurl windows build VS2015 OpenSSL HTTP2

I am currently trying to build Libcurl 7.54.0 with OpenSSL and HTTP2 on windows 10 using Visual Studio 2015 and I am getting these errors in the build log at the end of compilation:
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_new referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_del referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_send_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_frame_recv_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_invalid_frame_recv_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_data_chunk_recv_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_before_frame_send_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_frame_send_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_frame_not_send_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_stream_close_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_begin_headers_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_header_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_error_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_client_new referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_del referenced in function _http2_disconnect
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_send referenced in function _h2_session_send
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_mem_recv referenced in function _Curl_http2_switched
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_resume_data referenced in function _Curl_http2_done_sending
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_want_read referenced in function _should_close_session
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_want_write referenced in function _http2_perform_getsock
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_get_stream_user_data referenced in function _before_frame_send
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_set_stream_user_data referenced in function _Curl_http2_done
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_get_remote_settings referenced in function _on_frame_recv
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_upgrade referenced in function _Curl_http2_switched
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_pack_settings_payload referenced in function _Curl_http2_request_upgrade
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_strerror referenced in function _Curl_http2_switched
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_http2_strerror referenced in function _Curl_http2_strerror
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_priority_spec_init referenced in function _h2_pri_spec
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_submit_request referenced in function _http2_send
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_submit_priority referenced in function _h2_session_send
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_submit_rst_stream referenced in function _Curl_http2_done
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_submit_settings referenced in function _Curl_http2_switched
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_set_local_window_size referenced in function _Curl_http2_switched
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_version referenced in function _Curl_http2_ver
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_is_fatal referenced in function _Curl_http2_switched
1>..\..\..\..\build\Win32\VC14\LIB Release - DLL OpenSSL\curl.exe : fatal error LNK1120: 35 unresolved externals
According to OpenSSL & nghttp2 path on my computer, I have added the following to curl & libcurl project:
I have added the following folders to my additionnal library directories (curl project->properties->configuration properties->linker->general->additionnal library directories) :
C:\OpenSSL-Win32\lib
C:\nghttp2-1.22.0\lib
And added for both curl and libcurl project additionnal include directories (both projects->properties->configuration properties->c/c++->general->additionnal include directories) :
C:\OpenSSL-Win32\include
C:\nghttp2-1.22.0\lib\includes
I also added the definition of USE_NGHTTP2 to both project preprocessor definitions (both projects->properties->configuration properties->C/C++->Preprocessor->Preprocessor Definitions) in order to compile with nghttp2.
Finally, I am building using configuration "LIB Release - DLL OpenSSL" with target platform Win32.
Edit: the issue seems to be related to nghttp2 as I successfully build without the NGHTTP2 preprocessor definition.
I am surely missing something but I can't see what at the moment.
Thank you for your assistance
Lucas

Compile FFmpeg Zeranoe Build with Visual Studio 2013

I downloaded the most recent Zeranoe dev build here, included the header files to my code, placed extern "C" around the includes, since this is a C++ project and FFmpeg is a C library, and added the libs to Visual Studio as well, and I get this linker error:
1>Camera.obj : error LNK2019: unresolved external symbol _av_free referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _av_freep referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _av_frame_alloc referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _av_frame_free referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _avcodec_register_all referenced in function __catch$??0Camera#MicroDFV_Camera##QAE#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##0PAX#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _avcodec_alloc_context3 referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _avcodec_open2 referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _avcodec_close referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _av_init_packet referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _av_packet_unref referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _avcodec_find_encoder referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _avcodec_encode_video2 referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _av_opt_set referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>Camera.obj : error LNK2019: unresolved external symbol _av_image_alloc referenced in function __catch$?NewFrameReceived#Camera#MicroDFV_Camera##AAEXKKKGPAE#Z$0
1>M:\Desktop\OpenCVTest\Debug\OpenCVTest.exe : fatal error LNK1120: 14 unresolved externals
Searching here and on Google I found many recommendations, such as to add #pragma comment(lib,...), and that the libs are static, so their order is important, and none of this helps.
So I scratched my head even more and realized that the Zeranoe build is made with MinGW-w64, so probably it won't link with Visual Studio. I inspected the lib using dumpbin and the symbols on the libs don't have the underscore, so I am pretty sure it won't work.
The other Zeranoe builds for Windows don't have libs, they are just plain .exe or exe + .dll.
Will I have to make my own VS2013 build of FFmpeg to link it, or is there some alternative way?

linker problems for EasyHook in Visual C++ 10

I have downloaded EasyHook 2.7 source and I try to compile it in my Visual Studio 2012 environment.
After solving a lot of warnings, I have found other warnings that I cannot solve, and these are:
1>error.obj : error LNK2019: unresolved external symbol _CoTaskMemAlloc#4 referenced in function _RtlGetLastErrorStringCopy#0
1>error.obj : error LNK2019: unresolved external symbol _CopyMemory#12 referenced in function _RtlGetLastErrorStringCopy#0
1>reloc.obj : error LNK2019: unresolved external symbol _ud_init#4 referenced in function _LhDisassembleInstruction#20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_set_mode#8 referenced in function _LhDisassembleInstruction#20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_set_input_buffer#12 referenced in function _LhDisassembleInstruction#20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_set_syntax#8 referenced in function _LhDisassembleInstruction#20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_disassemble#4 referenced in function _LhDisassembleInstruction#20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_translate_intel#4 referenced in function _LhDisassembleInstruction#20
1>reloc.obj : error LNK2019: unresolved external symbol _ud_set_asm_buffer#12 referenced in function _LhDisassembleInstruction#20
1>C:\Users\Jaime Stuardo\Downloads\EasyHook-2.7.5159.0-Source\\Debug\x86\EasyHook32Drv.sys : fatal error LNK1120: 9 unresolved externals
What lib files I need to add so that the linker will not fail? notice that the first 2 functions belong to Windows API, so it is very curious it does not link.
Regards
Jaime
For the Windows functions, just look them up on MSDN. CoTaskMemAlloc says you need to link OLE32.LIB. CopyMemory says KERNEL32.LIB. The functions beginning with ud come from a library which Easyhook depends on: "EasyHook makes use of the udis86 library by Vivek.