Related
I've installed mapnik via vcpkg: vcpkg install mapnik
Also I've downloaded sources of mapnik and trying to build mapnik's demo c++ & Qt project - viewer - https://github.com/mapnik/mapnik/tree/master/demo/viewer
Also I have Visual Studio 2019 & Qt 5.12.4 for msvc2017.
I import viewer.pro file into Visual Studio, change Solution's Qt Version from x64 to x86, change compiler from 2019 to 2017 (v141) and get the build errors:
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::_Tree_iterator<class std::_Tree_val<struct std::_Tree_simple_types<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,struct mapnik::value_holder> > > > __thiscall std::_Tree<class std::_Tmap_traits<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct mapnik::value_holder,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,struct mapnik::value_holder> >,0> >::begin(void)" (__imp_?begin#?$_Tree#V?$_Tmap_traits#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##Uvalue_holder#mapnik##U?$less#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2#V?$allocator#U?$pair#$$CBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##Uvalue_holder#mapnik###std###2#$0A##std###std##QAE?AV?$_Tree_iterator#V?$_Tree_val#U?$_Tree_simple_types#U?$pair#$$CBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##Uvalue_holder#mapnik###std###std###std###2#XZ) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog##QAE#AAVlayer#mapnik##PAVQWidget###Z)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::_Tree_iterator<class std::_Tree_val<struct std::_Tree_simple_types<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,struct mapnik::value_holder> > > > __thiscall std::_Tree<class std::_Tmap_traits<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct mapnik::value_holder,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,struct mapnik::value_holder> >,0> >::end(void)" (__imp_?end#?$_Tree#V?$_Tmap_traits#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##Uvalue_holder#mapnik##U?$less#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2#V?$allocator#U?$pair#$$CBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##Uvalue_holder#mapnik###std###2#$0A##std###std##QAE?AV?$_Tree_iterator#V?$_Tree_val#U?$_Tree_simple_types#U?$pair#$$CBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##Uvalue_holder#mapnik###std###std###std###2#XZ) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog##QAE#AAVlayer#mapnik##PAVQWidget###Z)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::_Tree<class std::_Tmap_traits<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct mapnik::value_holder,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<struct std::pair<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const ,struct mapnik::value_holder> >,0> >::size(void)const " (__imp_?size#?$_Tree#V?$_Tmap_traits#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##Uvalue_holder#mapnik##U?$less#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2#V?$allocator#U?$pair#$$CBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##Uvalue_holder#mapnik###std###2#$0A##std###std##QBEIXZ) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog##QAE#AAVlayer#mapnik##PAVQWidget###Z)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::parameters::~parameters(void)" (__imp_??1parameters#mapnik##QAE#XZ) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog##QAE#AAVlayer#mapnik##PAVQWidget###Z)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::parameters::parameters(class mapnik::parameters const &)" (__imp_??0parameters#mapnik##QAE#ABV01##Z) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog##QAE#AAVlayer#mapnik##PAVQWidget###Z)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::value_adl_barrier::value::value(void)" (__imp_??0value#value_adl_barrier#mapnik##QAE#XZ) referenced in function "void __cdecl mapnik::`dynamic initializer for 'default_feature_value''(void)" (??__Edefault_feature_value#mapnik##YAXXZ)
1>mapwidget.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::value_adl_barrier::value::value(void)" (__imp_??0value#value_adl_barrier#mapnik##QAE#XZ)
1>styles_model.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::value_adl_barrier::value::value(void)" (__imp_??0value#value_adl_barrier#mapnik##QAE#XZ)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::value_adl_barrier::value::~value(void)" (__imp_??1value#value_adl_barrier#mapnik##QAE#XZ) referenced in function "void __cdecl mapnik::`dynamic atexit destructor for 'default_feature_value''(void)" (??__Fdefault_feature_value#mapnik##YAXXZ)
1>mapwidget.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::value_adl_barrier::value::~value(void)" (__imp_??1value#value_adl_barrier#mapnik##QAE#XZ)
1>styles_model.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall mapnik::value_adl_barrier::value::~value(void)" (__imp_??1value#value_adl_barrier#mapnik##QAE#XZ)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class mapnik::parameters & __thiscall mapnik::datasource::params(void)" (__imp_?params#datasource#mapnik##QAEAAVparameters#2#XZ) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog##QAE#AAVlayer#mapnik##PAVQWidget###Z)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall mapnik::layer::name(void)const " (__imp_?name#layer#mapnik##QBEABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog##QAE#AAVlayer#mapnik##PAVQWidget###Z)
1>layerlistmodel.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall mapnik::layer::name(void)const " (__imp_?name#layer#mapnik##QBEABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ)
1>mapwidget.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __thiscall mapnik::layer::name(void)const " (__imp_?name#layer#mapnik##QBEABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ)
1>layer_info_dialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::shared_ptr<class mapnik::datasource> __thiscall mapnik::layer::datasource(void)const " (__imp_?datasource#layer#mapnik##QBE?AV?$shared_ptr#Vdatasource#mapnik###std##XZ) referenced in function "public: __thiscall layer_info_dialog::layer_info_dialog(class mapnik::layer &,class QWidget *)" (??0layer_info_dialog##QAE#AAVlayer#mapnik##PAVQWidget###Z)
1>layerlistmodel.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::vector<class mapnik::layer,class std::allocator<class mapnik::layer> > & __thiscall mapnik::Map::layers(void)" (__imp_?layers#Map#mapnik##QAEAAV?$vector#Vlayer#mapnik##V?$allocator#Vlayer#mapnik###std###std##XZ) referenced in function "public: virtual int __thiscall LayerListModel::rowCount(class QModelIndex const &)const " (?rowCount#LayerListModel##UBEHABVQModelIndex###Z)
1>mapwidget.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::vector<class mapnik::layer,class std::allocator<class mapnik::layer> > & __thiscall mapnik::Map::layers(void)" (__imp_?layers#Map#mapnik##QAEAAV?$vector#Vlayer#mapnik##V?$allocator#Vlayer#mapnik###std###std##XZ)
1>layerlistmodel.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: double __thiscall mapnik::Map::scale(void)const " (__imp_?scale#Map#mapnik##QBENXZ) referenced in function "public: virtual class QVariant __thiscall LayerListModel::data(class QModelIndex const &,int)const " (?data#LayerListModel##UBE?AVQVariant##ABVQModelIndex##H#Z)
1>mapwidget.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: double __thiscall mapnik::Map::scale(void)const " (__imp_?scale#Map#mapnik##QBENXZ)
1>layerlistmodel.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall mapnik::layer::set_active(bool)" (__imp_?set_active#layer#mapnik##QAEX_N#Z) referenced in function "public: virtual bool __thiscall LayerListModel::setData(class QModelIndex const &,class QVariant const &,int)" (?setData#LayerListModel##UAE_NABVQModelIndex##ABVQVariant##H#Z)
1>layerlistmodel.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall mapnik::layer::active(void)const " (__imp_?active#layer#mapnik##QBE_NXZ) referenced in function "public: virtual class QVariant __thiscall LayerListModel::data(class QModelIndex const &,int)const " (?data#LayerListModel##UBE?AVQVariant##ABVQModelIndex##H#Z)
1>layerlistmodel.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall mapnik::layer::visible(double)const " (__imp_?visible#layer#mapnik##QBE_NN#Z) referenced in function "public: virtual class QVariant __thiscall LayerListModel::data(class QModelIndex const &,int)const " (?data#LayerListModel##UBE?AVQVariant##ABVQModelIndex##H#Z)
1>mapwidget.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall mapnik::layer::visible(double)const " (__imp_?visible#layer#mapnik##QBE_NN#Z)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class mapnik::datasource_cache & __cdecl mapnik::singleton<class mapnik::datasource_cache,class mapnik::CreateStatic>::instance(void)" (__imp_?instance#?$singleton#Vdatasource_cache#mapnik##VCreateStatic#2##mapnik##SAAAVdatasource_cache#2#XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall mapnik::datasource_cache::register_datasources(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (__imp_?register_datasources#datasource_cache#mapnik##QAE_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##_N#Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static bool __cdecl mapnik::freetype_engine::register_fonts(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (__imp_?register_fonts#freetype_engine#mapnik##SA_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##_N#Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl mapnik::setup(void)" (__imp_?setup#mapnik##YAXXZ) referenced in function
_mainmapnik::binary_function_call> > > const & __thiscall mapnik::rule::get_filter(void)const " (__imp_?get_filter#rule#mapnik##QBEABV?$shared_ptr#V?$variant#Uvalue_null#mapnik##_NHNVUnicodeString#icu_72##Uattribute#2#Uglobal_attribute#2#Ugeometry_type_attribute#2#V?$recursive_wrapper#U?$unary_node#Unegate#tags#mapnik###mapnik###util#mapbox##V?$recursive_wrapper#U?$binary_node#Uplus#tags#mapnik###mapnik###9mapbox##V?$recursive_wrapper#U?$binary_node#Uminus#tags#mapnik###mapnik###9mapbox##V?$recursive_wrapper#U?$binary_node#Umult#tags#mapnik###mapnik###9mapbox##V?$recursive_wrapper#U?$binary_node#Udiv#tags#mapnik###mapnik###9mapbox##V?$recursive_wrapper#U?$binary_node#Umod#tags#mapnik###mapnik###9mapbox##V?$recursive_wrapper#U?$binary_node#Uless#tags#mapnik###mapnik###9mapbox##V?$recursive_wrapper#U?$binary_node#Uless_equal#tags#mapnik###mapnik###9mapbox##V?$recursive_wrapper#U?$binary_node#Ugreater#tags#mapnik###mapnik###9mapbox##V?$recursive_wrapper#U?$binary_node#Ugreater_equal#tags#mapnik###mapnik###9mapbox##V?$recursive_wrapper#U?$binary_node#Uequal_to#tags#mapnik###mapnik###9mapbox##V?$recursive_wrapper#U?$binary_node#Unot_equal_to#tags#mapnik###mapnik###9mapbox##V?$recursive_wrapper#U?$unary_node#Ulogical_not#tags#mapnik###mapnik###9mapbox##V?$recursive_wrapper#U?$binary_node#Ulogical_and#tags#mapnik###mapnik###9mapbox##V?$recursive_wrapper#U?$binary_node#Ulogical_or#tags#mapnik###mapnik###9mapbox##V?$recursive_wrapper#Uregex_match_node#mapnik###9mapbox##V?$recursive_wrapper#Uregex_replace_node#mapnik###9mapbox##V?$recursive_wrapper#Uunary_function_call#mapnik###9mapbox##V?$recursive_wrapper#Ubinary_function_call#mapnik###9mapbox###util#mapbox###std##XZ) referenced in function "public: class QString __thiscall rule_node::name(void)const " (?name#rule_node##QBE?AVQString##XZ)
1>styles_model.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::vector<class mapnik::rule,class std::allocator<class mapnik::rule> > const & __thiscall mapnik::feature_type_style::get_rules(void)const " (__imp_?get_rules#feature_type_style#mapnik##QBEABV?$vector#Vrule#mapnik##V?$allocator#Vrule#mapnik###std###std##XZ) referenced in function "public: __thiscall StyleModel::StyleModel(class std::shared_ptr<class mapnik::Map>,class QObject *)" (??0StyleModel##QAE#V?$shared_ptr#VMap#mapnik###std##PAVQObject###Z)
1>debug\\viewer.exe : fatal error LNK1120: 84 unresolved externals
1>Done building project "viewer.vcxproj" -- FAILED.
How to build the project on msvc and Qt 5?
I complied c++ grpc file using protoc compiler, so i assume that that references should not give any problem.
I added "grpc\include" , "grpc\src" and "grpc\third_party\protobuf\src\google\protobuf" as include directory.
Interestingly, i'm getting :
error LNK2019: unresolved external symbol "public: __thiscall google::protobuf::internal::LogMessage::LogMessage(enum google::protobuf::LogLevel,char const *,int)" (??0LogMessage#internal#protobuf#google##QAE#W4LogLevel#23#PBDH#Z) referenced in function "int __cdecl google::
error LNK2001: unresolved external symbol "public: virtual bool __thiscall google::protobuf::io::ZeroCopyOutputStream::WriteAliasedRaw(void const *,int)" (?WriteAliasedRaw#ZeroCopyOutputStream#io#protobuf#google##UAE_NPBXH#Z)
error LNK2019: unresolved external symbol "public: bool __thiscall google::protobuf::MessageLite::ParseFromZeroCopyStream(class google::protobuf::io::ZeroCopyInputStream *)" (?ParseFromZeroCopyStream#MessageLite#protobuf#google##QAE_NPAVZeroCopyInputStream#io#23##Z) referenced in function "class grpc::Status __cdecl grpc::GenericDeserialize<class grpc::ProtoBufferReader,class facialpluginpoc::NoParams>(class grpc::ByteBuffer *,class google::protobuf::MessageLite *)" (??$GenericDeserialize#VProtoBufferReader#grpc##VNoParams#facialpluginpoc###grpc##YA?AVStatus#0#PAVByteBuffer#0#PAVMessageLite#protobuf#google###Z)
error LNK2001: unresolved external symbol "class grpc::CoreCodegenInterface * grpc::g_core_codegen_interface" (?g_core_codegen_interface#grpc##3PAVCoreCodegenInterface#1#A)
error LNK2001: unresolved external symbol "class grpc::GrpcLibraryInterface * grpc::g_glip" (?g_glip#grpc##3PAVGrpcLibraryInterface#1#A)
error LNK2019: unresolved external symbol "void __cdecl google::protobuf::internal::VerifyVersion(int,int,char const *)" (?VerifyVersion#internal#protobuf#google##YAXHHPBD#Z) referenced in function "void __cdecl InitDefaultsscc_info_NoParams_facialpluginpoc_2eproto(void)" (?InitDefaultsscc_info_NoParams_facialpluginpoc_2eproto##YAXXZ)
1>facialpluginpoc.pb.obj : error LNK2019: unresolved external symbol "void __cdecl google::protobuf::internal::OnShutdownRun(void (__cdecl*)(void const *),void const *)" (?OnShutdownRun#internal#protobuf#google##YAXP6AXPBX#Z0#Z) referenced in function "void __cdecl google::protobuf::internal::OnShutdownDestroyMessage(void const *)" (?OnShutdownDestroyMessage#internal#protobuf#google##YAXPBX#Z)
1>facialpluginpoc.pb.obj : error LNK2019: unresolved external symbol "private: __int64 __thiscall google::protobuf::io::CodedInputStream::ReadVarint32Fallback(unsigned int)" (?ReadVarint32Fallback#CodedInputStream#io#protobuf#google##AAE_JI#Z) referenced in function "public: bool __thiscall google::protobuf::io::CodedInputStream::ReadVarint32(unsigned int *)" (?ReadVarint32#CodedInputStream#io#protobuf#google##QAE_NPAI#Z)
1>facialpluginpoc.pb.obj : error LNK2019: unresolved external symbol "private: unsigned int __thiscall google::protobuf::io::CodedInputStream::ReadTagFallback(unsigned int)" (?ReadTagFallback#CodedInputStream#io#protobuf#google##AAEII#Z) referenced in function "public: struct std::pair<unsigned int,bool> __thiscall google::protobuf::io::CodedInputStream::ReadTagWithCutoffNoLastTag(unsigned int)" (?ReadTagWithCutoffNoLastTag#CodedInputStream#io#protobuf#google##QAE?AU?$pair#I_N#std##I#Z)
1>facialpluginpoc.pb.obj : error LNK2019: unresolved external symbol "public: static unsigned char * __cdecl google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned char *)" (?WriteStringWithSizeToArray#CodedOutputStream#io#protobuf#google##SAPAEABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##PAE#Z) referenced in function "public: static unsigned char * __cdecl google::protobuf::internal::WireFormatLite::WriteBytesToArray(int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned char *)" (?WriteBytesToArray#WireFormatLite#internal#protobuf#google##SAPAEHABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##PAE#Z)
1>facialpluginpoc.pb.obj : error LNK2019: unresolved external symbol "public: void * __thiscall google::protobuf::internal::ArenaImpl::AllocateAligned(unsigned int)" (?AllocateAligned#ArenaImpl#internal#protobuf#google##QAEPAXI#Z) referenced in function "private: void * __thiscall google::protobuf::Arena::AllocateInternal<struct google::protobuf::internal::InternalMetadataWithArenaBase<class google::protobuf::UnknownFieldSet,class google::protobuf::internal::InternalMetadataWithArena>::Container>(bool)" (??$AllocateInternal#UContainer#?$InternalMetadataWithArenaBase#VUnknownFieldSet#protobuf#google##VInternalMetadataWithArena#internal#23##internal#protobuf#google###Arena#protobuf#google##AAEPAX_N#Z)
error LNK2019: unresolved external symbol "public: static bool __cdecl google::protobuf::internal::WireFormatLite::ReadBytes(class google::protobuf::io::CodedInputStream *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > *)" (?ReadBytes#WireFormatLite#internal#protobuf#google##SA_NPAVCodedInputStream#io#34#PAV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z) referenced in function "public: virtual bool __thiscall facialpluginpoc::Result::MergePartialFromCodedStream(class google::protobuf::io::CodedInputStream *)" (?MergePartialFromCodedStream#Result#facialpluginpoc##UAE_NPAVCodedInputStream#io#protobuf#google###Z)
I have included all the required header files as project dependency, but still facing this issue.
Is this GRPC library/build/environment issue ? How to resolve this ?
C++ has two stages compiling and linking. From the errors in the post, looks like your includes are good which is not giving any compiler error but all are linker errors. During linking phase, it may be missing "google::protobuf::io" library or lib files.
I'm trying to build my application and statically linking it to Boost 1.57 but I get 6 linking errors:
>LINK : warning LNK4044: unrecognized option '/static'; ignored
2>ShaderProgram.obj : error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category#system#boost##YAABVerror_category#12#XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'native_ecat''(void)" (??__Enative_ecat#system#boost##YAXXZ)
2>ShaderProgram.obj : error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category#system#boost##YAABVerror_category#12#XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'errno_ecat''(void)" (??__Eerrno_ecat#system#boost##YAXXZ)
2>ShaderProgram.obj : error LNK2019: unresolved external symbol "void __cdecl boost::filesystem::path_traits::convert(char const *,char const *,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,class std::codecvt<wchar_t,char,int> const &)" (?convert#path_traits#filesystem#boost##YAXPBD0AAV?$basic_string#_WU?$char_traits#_W#std##V?$allocator#_W#2##std##ABV?$codecvt#_WDH#5##Z) referenced in function "public: __thiscall boost::filesystem::path::path<char const [8]>(char const (&)[8],void *)" (??$?0$$BY07$$CBD#path#filesystem#boost##QAE#AAY07$$CBDPAX#Z)
2>ShaderProgram.obj : error LNK2019: unresolved external symbol "void __cdecl boost::filesystem::path_traits::convert(wchar_t const *,wchar_t const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,class std::codecvt<wchar_t,char,int> const &)" (?convert#path_traits#filesystem#boost##YAXPB_W0AAV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##ABV?$codecvt#_WDH#5##Z) referenced in function "void __cdecl boost::filesystem::path_traits::convert(wchar_t const *,wchar_t const *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (?convert#path_traits#filesystem#boost##YAXPB_W0AAV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
2>ShaderProgram.obj : error LNK2019: unresolved external symbol "public: class boost::filesystem::path & __thiscall boost::filesystem::path::operator/=(class boost::filesystem::path const &)" (??_0path#filesystem#boost##QAEAAV012#ABV012##Z) referenced in function "class boost::filesystem::path __cdecl boost::filesystem::operator/(class boost::filesystem::path const &,class boost::filesystem::path const &)" (??Kfilesystem#boost##YA?AVpath#01#ABV201#0#Z)
2>ShaderProgram.obj : error LNK2019: unresolved external symbol "public: static class std::codecvt<wchar_t,char,int> const & __cdecl boost::filesystem::path::codecvt(void)" (?codecvt#path#filesystem#boost##SAABV?$codecvt#_WDH#std##XZ) referenced in function "public: __thiscall boost::filesystem::path::path<char const [8]>(char const (&)[8],void *)" (??$?0$$BY07$$CBD#path#filesystem#boost##QAE#AAY07$$CBDPAX#Z)
2>C:\Users\Structo\Desktop\ReStructo\build-release\src\Release\ReStructo.exe : fatal error LNK1120: 6 unresolved externals
What I did:
I built boost with:
b2 link=static variant=release runtime-link=static
In my Cmake, I have
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "-static")
set(Boost_USE_STATIC_RUNTIME ON)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost REQUIRED COMPONENTS filesystem system)
In Visual Studio 2013
I set solution configuration to Release
Runtime library to Multithreaded
Set the path to the .libs in VC++ Directories->Library path
Any idea how I could fix this?
Thank you very much for your time!
I'm writing a C++ program using Chilkat library. I've linked the whole library to the project as follows:
project > properties > C/C++ > General > Additional Include Directories > C:\chilkat\include (That's where I have the library)
AND
project > properties > Linker > Input > Additional Dependencies > ... C:\chilkat\libs\ChilkatDbgDll.lib; ...
Chilkat library came with 4 kinds of .lib files, each for different kinds of runtime, so I used the .lib which best suited my project (Multi-Threaded Debug DLL).
The damn thing still gives me this:
1>------ Build started: Project: botnet, Configuration: Debug Win32 ------
1>Build started 28.08.2013 20:47:29.
1>InitializeBuildStatus:
1> Touching "Debug\botnet.unsuccessfulbuild".
1>ClCompile:
1> botnet.cpp
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__getsockopt#20 referenced in function "public: void __thiscall ChilkatSocket::logSocketOptions(class LogBase &)" (?logSocketOptions#ChilkatSocket##QAEXAAVLogBase###Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__setsockopt#20 referenced in function "private: void __thiscall ChilkatSocket::checkSetBufSizes(class LogBase &)" (?checkSetBufSizes#ChilkatSocket##AAEXAAVLogBase###Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__accept#12 referenced in function "private: bool __thiscall ChilkatSocket::acceptNextConnection2(class ChilkatSocket &,bool,unsigned int,class LogBase &,bool &)" (?acceptNextConnection2#ChilkatSocket##AAE_NAAV1#_NIAAVLogBase##AA_N#Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__ioctlsocket#12 referenced in function "public: void __thiscall ChilkatSocket::setNonBlocking(void)" (?setNonBlocking#ChilkatSocket##QAEXXZ)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__WSAGetLastError#0 referenced in function "private: bool __thiscall ChilkatSocket::createSocket_ipv4(class LogBase &,bool)" (?createSocket_ipv4#ChilkatSocket##AAE_NAAVLogBase##_N#Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__socket#12 referenced in function "private: bool __thiscall ChilkatSocket::createSocket_ipv4(class LogBase &,bool)" (?createSocket_ipv4#ChilkatSocket##AAE_NAAVLogBase##_N#Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__WSAStartup#8 referenced in function "bool __cdecl startupWSA(class LogBase &)" (?startupWSA##YA_NAAVLogBase###Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__ntohs#4 referenced in function "private: bool __thiscall ChilkatSocket::ck_getsockname_ipv4(class chilkat::StringBuffer &,int &,class LogBase &)" (?ck_getsockname_ipv4#ChilkatSocket##AAE_NAAVStringBuffer#chilkat##AAHAAVLogBase###Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__inet_ntoa#4 referenced in function "private: bool __thiscall ChilkatSocket::ck_getsockname_ipv4(class chilkat::StringBuffer &,int &,class LogBase &)" (?ck_getsockname_ipv4#ChilkatSocket##AAE_NAAVStringBuffer#chilkat##AAHAAVLogBase###Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__getsockname#12 referenced in function "private: bool __thiscall ChilkatSocket::ck_getsockname_ipv4(class chilkat::StringBuffer &,int &,class LogBase &)" (?ck_getsockname_ipv4#ChilkatSocket##AAE_NAAVStringBuffer#chilkat##AAHAAVLogBase###Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__gethostbyname#4 referenced in function "struct hostent * __cdecl ck_gethostbyname(char const *,class LogBase &)" (?ck_gethostbyname##YAPAUhostent##PBDAAVLogBase###Z)
1>ChilkatDbgDll.lib(HostnameResolve.obj) : error LNK2001: unresolved external symbol __imp__gethostbyname#4
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__getpeername#12 referenced in function "public: bool __thiscall ChilkatSocket::GetPeerName(class chilkat::StringBuffer &,int &)" (?GetPeerName#ChilkatSocket##QAE_NAAVStringBuffer#chilkat##AAH#Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__inet_addr#4 referenced in function "public: static bool __cdecl ChilkatSocket::isDottedIpAddress(char const *)" (?isDottedIpAddress#ChilkatSocket##SA_NPBD#Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__htons#4 referenced in function "public: static bool __cdecl ChilkatSocket::isDottedIpAddress(char const *)" (?isDottedIpAddress#ChilkatSocket##SA_NPBD#Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__connect#12 referenced in function "private: bool __thiscall ChilkatSocket::connectSocket2_ipv4(char const *,int,unsigned int,class LogBase &,class ProgressMonitor *,bool &)" (?connectSocket2_ipv4#ChilkatSocket##AAE_NPBDHIAAVLogBase##PAVProgressMonitor##AA_N#Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__select#20 referenced in function "public: bool __thiscall ChilkatSocket::waitWriteable2(unsigned int,class LogBase &)" (?waitWriteable2#ChilkatSocket##QAE_NIAAVLogBase###Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol ___WSAFDIsSet#8 referenced in function "public: bool __thiscall ChilkatSocket::waitWriteableMs2(unsigned int,bool,class SocketParams &,class LogBase &)" (?waitWriteableMs2#ChilkatSocket##QAE_NI_NAAVSocketParams##AAVLogBase###Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__bind#12 referenced in function "private: bool __thiscall ChilkatSocket::bindSysCall2(void *,int,class LogBase &)" (?bindSysCall2#ChilkatSocket##AAE_NPAXHAAVLogBase###Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__listen#8 referenced in function "public: bool __thiscall ChilkatSocket::listenOnPort(int &,int,bool,class LogBase &)" (?listenOnPort#ChilkatSocket##QAE_NAAHH_NAAVLogBase###Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__gethostname#8 referenced in function "private: static bool __cdecl ChilkatSocket::getLocalHostName_inner(class chilkat::StringBuffer &,class LogBase &)" (?getLocalHostName_inner#ChilkatSocket##CA_NAAVStringBuffer#chilkat##AAVLogBase###Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__closesocket#4 referenced in function "public: bool __thiscall ChilkatSocket::NewSocketAndListen(bool,class LogBase &)" (?NewSocketAndListen#ChilkatSocket##QAE_N_NAAVLogBase###Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__shutdown#8 referenced in function "public: bool __thiscall ChilkatSocket::NewSocketAndListen(bool,class LogBase &)" (?NewSocketAndListen#ChilkatSocket##QAE_N_NAAVLogBase###Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__recv#16 referenced in function "public: bool __thiscall ChilkatSocket::IsConnected(class LogBase &)" (?IsConnected#ChilkatSocket##QAE_NAAVLogBase###Z)
1>ChilkatDbgDll.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__send#16 referenced in function "public: bool __thiscall ChilkatSocket::SendBytes2(unsigned char const *,unsigned int,unsigned int,unsigned int,class LogBase &,class SocketParams &)" (?SendBytes2#ChilkatSocket##QAE_NPBEIIIAAVLogBase##AAVSocketParams###Z)
1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertVerifyRevocation#28 referenced in function "public: int __thiscall MsCertificate::checkRevoked(class LogBase &)" (?checkRevoked#MsCertificate##QAEHAAVLogBase###Z)
1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertFreeCertificateContext#4 referenced in function "public: void __thiscall MsCertificate::dotNetDispose(void)" (?dotNetDispose#MsCertificate##QAEXXZ)
1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2001: unresolved external symbol __imp__CertFreeCertificateContext#4
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2001: unresolved external symbol __imp__CertFreeCertificateContext#4
1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertNameToStrW#20 referenced in function "void __cdecl _getCertNameStr(struct _CRYPTOAPI_BLOB *,unsigned long,class XString &)" (?_getCertNameStr##YAXPAU_CRYPTOAPI_BLOB##KAAVXString###Z)
1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertDuplicateCertificateContext#4 referenced in function "public: __thiscall MsCertificate::MsCertificate(struct _CERT_CONTEXT const *,bool,class LogBase &)" (??0MsCertificate##QAE#PBU_CERT_CONTEXT##_NAAVLogBase###Z)
1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2001: unresolved external symbol __imp__CertDuplicateCertificateContext#4
1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertSetCertificateContextProperty#16 referenced in function "public: bool __thiscall MsCertificate::linkPrivateKey(class XString &,bool,bool,class LogBase &)" (?linkPrivateKey#MsCertificate##QAE_NAAVXString##_N1AAVLogBase###Z)
1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2001: unresolved external symbol __imp__CertSetCertificateContextProperty#16
1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CryptDecodeObject#28 referenced in function "public: static void __cdecl MsCertificate::getRfc822NameFromContext(struct _CERT_CONTEXT const *,class XString &)" (?getRfc822NameFromContext#MsCertificate##SAXPBU_CERT_CONTEXT##AAVXString###Z)
1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertGetIntendedKeyUsage#16 referenced in function "public: unsigned int __thiscall MsCertificate::getIntendedKeyUsage(void)" (?getIntendedKeyUsage#MsCertificate##QAEIXZ)
1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertGetCertificateContextProperty#16 referenced in function "private: bool __thiscall MsCertificate::getKeyProviderInfo(int,class LogBase &)" (?getKeyProviderInfo#MsCertificate##AAE_NHAAVLogBase###Z)
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2001: unresolved external symbol __imp__CertGetCertificateContextProperty#16
1>ChilkatDbgDll.lib(MsCertificate.obj) : error LNK2019: unresolved external symbol __imp__CertCreateCertificateContext#12 referenced in function "public: static class MsCertificate * __cdecl MsCertificate::createFromDer(unsigned char const *,unsigned int,class LogBase &)" (?createFromDer#MsCertificate##SAPAV1#PBEIAAVLogBase###Z)
1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertDuplicateStore#4 referenced in function "public: class CertificateStore * __thiscall CertificateStore::dupStore(class LogBase *)" (?dupStore#CertificateStore##QAEPAV1#PAVLogBase###Z)
1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertEnumCertificatesInStore#8 referenced in function "private: void __thiscall CertificateStore::deleteKeyContainers(void)" (?deleteKeyContainers#CertificateStore##AAEXXZ)
1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertCloseStore#8 referenced in function "public: void __thiscall CertificateStore::dotNetDispose(void)" (?dotNetDispose#CertificateStore##QAEXXZ)
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2001: unresolved external symbol __imp__CertCloseStore#8
1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertOpenStore#20 referenced in function "public: static class CertificateStore * __cdecl CertificateStore::createMemoryStore(class LogBase *)" (?createMemoryStore#CertificateStore##SAPAV1#PAVLogBase###Z)
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2001: unresolved external symbol __imp__CertOpenStore#20
1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertFindCertificateInStore#24 referenced in function "public: class MsCertificate * __thiscall CertificateStore::findIssuer(class MsCertificate &,class LogBase &,bool)" (?findIssuer#CertificateStore##QAEPAVMsCertificate##AAV2#AAVLogBase##_N#Z)
1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertAddEncodedCertificateToStore#24 referenced in function "public: bool __thiscall CertificateStore::addEncodedCertificateUtf8(char const *,class LogBase &)" (?addEncodedCertificateUtf8#CertificateStore##QAE_NPBDAAVLogBase###Z)
1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertAddCertificateContextToStore#16 referenced in function "public: bool __thiscall CertificateStore::addCertWithPrivateKey(class MsCertificate &,class XString &,bool,class LogBase &,bool)" (?addCertWithPrivateKey#CertificateStore##QAE_NAAVMsCertificate##AAVXString##_NAAVLogBase##2#Z)
1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertSaveStore#24 referenced in function "private: bool __thiscall CertificateStore::saveCertStore(class LogBase &)" (?saveCertStore#CertificateStore##AAE_NAAVLogBase###Z)
1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertDeleteCertificateFromStore#4 referenced in function "public: bool __thiscall CertificateStore::removeCertificate(class MsCertificate *,class LogBase &)" (?removeCertificate#CertificateStore##QAE_NPAVMsCertificate##AAVLogBase###Z)
1>ChilkatDbgDll.lib(CertificateStore.obj) : error LNK2019: unresolved external symbol __imp__CertGetSubjectCertificateFromStore#12 referenced in function "public: class MsCertificate * __thiscall CertificateStore::findCertificate(struct _CERT_INFO *)" (?findCertificate#CertificateStore##QAEPAVMsCertificate##PAU_CERT_INFO###Z)
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2001: unresolved external symbol __imp__CertGetSubjectCertificateFromStore#12
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptMsgControl#16 referenced in function "private: static bool __cdecl _ckMsCrypto::msDecryptInnerAlt(class DataBuffer const &,class DataBuffer &,class Certificate * *,class LogBase &)" (?msDecryptInnerAlt#_ckMsCrypto##CA_NABVDataBuffer##AAV2#PAPAVCertificate##AAVLogBase###Z)
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptMsgGetParam#20 referenced in function "private: static bool __cdecl _ckMsCrypto::msDecryptInnerAlt(class DataBuffer const &,class DataBuffer &,class Certificate * *,class LogBase &)" (?msDecryptInnerAlt#_ckMsCrypto##CA_NABVDataBuffer##AAV2#PAPAVCertificate##AAVLogBase###Z)
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptMsgClose#4 referenced in function "private: static bool __cdecl _ckMsCrypto::msDecryptInnerAlt(class DataBuffer const &,class DataBuffer &,class Certificate * *,class LogBase &)" (?msDecryptInnerAlt#_ckMsCrypto##CA_NABVDataBuffer##AAV2#PAPAVCertificate##AAVLogBase###Z)
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptMsgUpdate#16 referenced in function "private: static bool __cdecl _ckMsCrypto::msDecryptInnerAlt(class DataBuffer const &,class DataBuffer &,class Certificate * *,class LogBase &)" (?msDecryptInnerAlt#_ckMsCrypto##CA_NABVDataBuffer##AAV2#PAPAVCertificate##AAVLogBase###Z)
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptMsgOpenToDecode#24 referenced in function "private: static bool __cdecl _ckMsCrypto::msDecryptInnerAlt(class DataBuffer const &,class DataBuffer &,class Certificate * *,class LogBase &)" (?msDecryptInnerAlt#_ckMsCrypto##CA_NABVDataBuffer##AAV2#PAPAVCertificate##AAVLogBase###Z)
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptDecryptMessage#24 referenced in function "private: static bool __cdecl _ckMsCrypto::msDecryptInner(class DataBuffer const &,class DataBuffer &,class Certificate * *,class LogBase &)" (?msDecryptInner#_ckMsCrypto##CA_NABVDataBuffer##AAV2#PAPAVCertificate##AAVLogBase###Z)
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptSignMessage#28 referenced in function "public: static bool __cdecl _ckMsCrypto::msCryptoSignature(class CryptoSettings2 &,class Certificate &,bool,class SystemCerts &,unsigned char const *,unsigned int,int,class DataBuffer &,class LogBase &)" (?msCryptoSignature#_ckMsCrypto##SA_NAAVCryptoSettings2##AAVCertificate##_NAAVSystemCerts##PBEIHAAVDataBuffer##AAVLogBase###Z)
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptEncodeObject#20 referenced in function "public: static bool __cdecl _ckMsCrypto::msCryptoSignature(class CryptoSettings2 &,class Certificate &,bool,class SystemCerts &,unsigned char const *,unsigned int,int,class DataBuffer &,class LogBase &)" (?msCryptoSignature#_ckMsCrypto##SA_NAAVCryptoSettings2##AAVCertificate##_NAAVSystemCerts##PBEIHAAVDataBuffer##AAVLogBase###Z)
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptVerifyMessageSignature#28 referenced in function "private: static bool __cdecl _ckMsCrypto::msVerifySignatureInner(class CryptoSettings2 &,class DataBuffer const &,class DataBuffer &,class ExtPtrArray &,class LogBase &)" (?msVerifySignatureInner#_ckMsCrypto##CA_NAAVCryptoSettings2##ABVDataBuffer##AAV3#AAVExtPtrArray##AAVLogBase###Z)
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptVerifyDetachedMessageSignature#32 referenced in function "private: static bool __cdecl _ckMsCrypto::msVerifyDetachedSignatureInner(class CryptoSettings2 &,class DataBuffer const &,unsigned char const *,unsigned long,class ExtPtrArray &,class LogBase &)" (?msVerifyDetachedSignatureInner#_ckMsCrypto##CA_NAAVCryptoSettings2##ABVDataBuffer##PBEKAAVExtPtrArray##AAVLogBase###Z)
1>ChilkatDbgDll.lib(_ckMsCrypto.obj) : error LNK2019: unresolved external symbol __imp__CryptEncryptMessage#28 referenced in function "private: static bool __cdecl _ckMsCrypto::msEncryptInner(class CryptoSettings2 &,unsigned char const *,unsigned long,class DataBuffer &,class ExtPtrArray &,class LogBase &)" (?msEncryptInner#_ckMsCrypto##CA_NAAVCryptoSettings2##PBEKAAVDataBuffer##AAVExtPtrArray##AAVLogBase###Z)
1>c:\users\simboyd\documents\visual studio 2010\Projects\botnet\Debug\botnet.exe : fatal error LNK1120: 54 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.33
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Any idea how to fix this? Thanks in advance.
If anybody is wondering how I fixed it: add Crypt32.lib and ws2_32.lib to additional dependencies (Linker > Input).
You're not linking the windows sockets import lib. Their library won't pull it in for you. It needs to be added to your linker-dependencies as well. It looks like their library is actually a static lib that expects your program to be linked as a MT DLL.
Add ws2_32.lib to your library list on your linker settings configuration (where you added your 3rd-party library).
It looks like you need to link to Ws2_32.lib which is the import library winsock.
I'm trying to use OpenCV 2.3.1 for a video capture and processing app. I downloaded the precompiled libraries from here and went to compile a test application using the static libraries found in the build\x86\vc10\staticlib of the download folder. Upon trying to compile, Visual Studio greets me with the linker errors shown below. Having worked with libpng, gzip, and a few others in the past, I recognize the functions from those libraries in the linker errors.
Does using the precompiled libraries of OpenCV also require me to link in libpng, libjpeg, gzip, and numerous others, or am I missing something?
1>opencv_core231d.lib(persistence.obj) : error LNK2019: unresolved external symbol _gzputs referenced in function "void __cdecl icvPuts(struct CvFileStorage *,char const *)" (?icvPuts##YAXPAUCvFileStorage##PBD#Z)
1>opencv_core231d.lib(persistence.obj) : error LNK2019: unresolved external symbol _gzclose referenced in function "void __cdecl icvClose(struct CvFileStorage *)" (?icvClose##YAXPAUCvFileStorage###Z)
1>opencv_core231d.lib(persistence.obj) : error LNK2019: unresolved external symbol _gzopen referenced in function _cvOpenFileStorage
1>opencv_core231d.lib(persistence.obj) : error LNK2019: unresolved external symbol _gzgets referenced in function "char * __cdecl icvGets(struct CvFileStorage *,char *,int)" (?icvGets##YAPADPAUCvFileStorage##PADH#Z)
1>opencv_core231d.lib(persistence.obj) : error LNK2019: unresolved external symbol _gzrewind referenced in function "void __cdecl icvRewind(struct CvFileStorage *)" (?icvRewind##YAXPAUCvFileStorage###Z)
1>opencv_core231d.lib(persistence.obj) : error LNK2019: unresolved external symbol _gzeof referenced in function "int __cdecl icvEof(struct CvFileStorage *)" (?icvEof##YAHPAUCvFileStorage###Z)
1>opencv_highgui231d.lib(window_w32.obj) : error LNK2019: unresolved external symbol __imp__CreateToolbarEx#52 referenced in function "int __cdecl icvCreateTrackbar(char const *,char const *,int *,int,void (__cdecl*)(int),void (__cdecl*)(int,void *),void *)" (?icvCreateTrackbar##YAHPBD0PAHHP6AXH#ZP6AXHPAX#Z3#Z)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _AVIFileRelease#4 referenced in function "public: virtual void __thiscall CvCaptureAVI_VFW::close(void)" (?close#CvCaptureAVI_VFW##UAEXXZ)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _AVIStreamRelease#4 referenced in function "public: virtual void __thiscall CvCaptureAVI_VFW::close(void)" (?close#CvCaptureAVI_VFW##UAEXXZ)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _AVIStreamGetFrameClose#4 referenced in function "public: virtual void __thiscall CvCaptureAVI_VFW::close(void)" (?close#CvCaptureAVI_VFW##UAEXXZ)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _AVIStreamGetFrameOpen#8 referenced in function "public: virtual bool __thiscall CvCaptureAVI_VFW::open(char const *)" (?open#CvCaptureAVI_VFW##UAE_NPBD#Z)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _AVIStreamInfoA#12 referenced in function "public: virtual bool __thiscall CvCaptureAVI_VFW::open(char const *)" (?open#CvCaptureAVI_VFW##UAE_NPBD#Z)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _AVIFileGetStream#16 referenced in function "public: virtual bool __thiscall CvCaptureAVI_VFW::open(char const *)" (?open#CvCaptureAVI_VFW##UAE_NPBD#Z)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _AVIFileOpenA#16 referenced in function "public: virtual bool __thiscall CvCaptureAVI_VFW::open(char const *)" (?open#CvCaptureAVI_VFW##UAE_NPBD#Z)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _AVIFileInit#0 referenced in function "void __cdecl icvInitCapture_VFW(void)" (?icvInitCapture_VFW##YAXXZ)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _AVIStreamGetFrame#8 referenced in function "public: virtual bool __thiscall CvCaptureAVI_VFW::grabFrame(void)" (?grabFrame#CvCaptureAVI_VFW##UAE_NXZ)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _ICClose#4 referenced in function "protected: void __thiscall CvCaptureCAM_VFW::closeHIC(void)" (?closeHIC#CvCaptureCAM_VFW##IAEXXZ)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _ICSendMessage#16 referenced in function "protected: void __thiscall CvCaptureCAM_VFW::closeHIC(void)" (?closeHIC#CvCaptureCAM_VFW##IAEXXZ)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _capCreateCaptureWindowA#32 referenced in function "public: virtual bool __thiscall CvCaptureCAM_VFW::open(int)" (?open#CvCaptureCAM_VFW##UAE_NH#Z)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _capGetDriverDescriptionA#20 referenced in function "public: virtual bool __thiscall CvCaptureCAM_VFW::open(int)" (?open#CvCaptureCAM_VFW##UAE_NH#Z)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _ICDecompress referenced in function "public: virtual struct _IplImage * __thiscall CvCaptureCAM_VFW::retrieveFrame(int)" (?retrieveFrame#CvCaptureCAM_VFW##UAEPAU_IplImage##H#Z)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _ICOpen#12 referenced in function "public: virtual struct _IplImage * __thiscall CvCaptureCAM_VFW::retrieveFrame(int)" (?retrieveFrame#CvCaptureCAM_VFW##UAEPAU_IplImage##H#Z)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _AVIStreamSetFormat#16 referenced in function "protected: bool __thiscall CvVideoWriter_VFW::createStreams(struct CvSize,bool)" (?createStreams#CvVideoWriter_VFW##IAE_NUCvSize##_N#Z)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _AVIMakeCompressedStream#16 referenced in function "protected: bool __thiscall CvVideoWriter_VFW::createStreams(struct CvSize,bool)" (?createStreams#CvVideoWriter_VFW##IAE_NUCvSize##_N#Z)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _AVISaveOptions#20 referenced in function "protected: bool __thiscall CvVideoWriter_VFW::createStreams(struct CvSize,bool)" (?createStreams#CvVideoWriter_VFW##IAE_NUCvSize##_N#Z)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _AVIFileCreateStreamA#12 referenced in function "protected: bool __thiscall CvVideoWriter_VFW::createStreams(struct CvSize,bool)" (?createStreams#CvVideoWriter_VFW##IAE_NUCvSize##_N#Z)
1>opencv_highgui231d.lib(cap_vfw.obj) : error LNK2019: unresolved external symbol _AVIStreamWrite#32 referenced in function "public: virtual bool __thiscall CvVideoWriter_VFW::writeFrame(struct _IplImage const *)" (?writeFrame#CvVideoWriter_VFW##UAE_NPBU_IplImage###Z)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_image_destroy referenced in function "public: void __thiscall cv::Jpeg2KDecoder::close(void)" (?close#Jpeg2KDecoder#cv##QAEXXZ)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_stream_close referenced in function "public: void __thiscall cv::Jpeg2KDecoder::close(void)" (?close#Jpeg2KDecoder#cv##QAEXXZ)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_image_decode referenced in function "public: virtual bool __thiscall cv::Jpeg2KDecoder::readHeader(void)" (?readHeader#Jpeg2KDecoder#cv##UAE_NXZ)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_stream_fopen referenced in function "public: virtual bool __thiscall cv::Jpeg2KDecoder::readHeader(void)" (?readHeader#Jpeg2KDecoder#cv##UAE_NXZ)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_matrix_destroy referenced in function "public: virtual bool __thiscall cv::Jpeg2KDecoder::readData(class cv::Mat &)" (?readData#Jpeg2KDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_image_readcmpt referenced in function "public: virtual bool __thiscall cv::Jpeg2KDecoder::readData(class cv::Mat &)" (?readData#Jpeg2KDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_matrix_create referenced in function "public: virtual bool __thiscall cv::Jpeg2KDecoder::readData(class cv::Mat &)" (?readData#Jpeg2KDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_image_getcmptbytype referenced in function "public: virtual bool __thiscall cv::Jpeg2KDecoder::readData(class cv::Mat &)" (?readData#Jpeg2KDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_cmprof_destroy referenced in function "public: virtual bool __thiscall cv::Jpeg2KDecoder::readData(class cv::Mat &)" (?readData#Jpeg2KDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_image_chclrspc referenced in function "public: virtual bool __thiscall cv::Jpeg2KDecoder::readData(class cv::Mat &)" (?readData#Jpeg2KDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_cmprof_createfromclrspc referenced in function "public: virtual bool __thiscall cv::Jpeg2KDecoder::readData(class cv::Mat &)" (?readData#Jpeg2KDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_image_encode referenced in function "public: virtual bool __thiscall cv::Jpeg2KEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#Jpeg2KEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_image_strtofmt referenced in function "public: virtual bool __thiscall cv::Jpeg2KEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#Jpeg2KEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_image_create referenced in function "public: virtual bool __thiscall cv::Jpeg2KEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#Jpeg2KEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_image_writecmpt referenced in function "protected: bool __thiscall cv::Jpeg2KEncoder::writeComponent8u(void *,class cv::Mat const &)" (?writeComponent8u#Jpeg2KEncoder#cv##IAE_NPAXABVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_init referenced in function "public: __thiscall cv::JasperInitializer::JasperInitializer(void)" (??0JasperInitializer#cv##QAE#XZ)
1>opencv_highgui231d.lib(grfmt_jpeg2000.obj) : error LNK2019: unresolved external symbol _jas_cleanup referenced in function "public: __thiscall cv::JasperInitializer::~JasperInitializer(void)" (??1JasperInitializer#cv##QAE#XZ)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_destroy_read_struct referenced in function "public: void __thiscall cv::PngDecoder::close(void)" (?close#PngDecoder#cv##QAEXXZ)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_error referenced in function "protected: static void __cdecl cv::PngDecoder::readDataFromBuf(void *,unsigned char *,unsigned int)" (?readDataFromBuf#PngDecoder#cv##KAXPAXPAEI#Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_get_io_ptr referenced in function "protected: static void __cdecl cv::PngDecoder::readDataFromBuf(void *,unsigned char *,unsigned int)" (?readDataFromBuf#PngDecoder#cv##KAXPAXPAEI#Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_get_IHDR referenced in function "public: virtual bool __thiscall cv::PngDecoder::readHeader(void)" (?readHeader#PngDecoder#cv##UAE_NXZ)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_read_info referenced in function "public: virtual bool __thiscall cv::PngDecoder::readHeader(void)" (?readHeader#PngDecoder#cv##UAE_NXZ)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_init_io referenced in function "public: virtual bool __thiscall cv::PngDecoder::readHeader(void)" (?readHeader#PngDecoder#cv##UAE_NXZ)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_read_fn referenced in function "public: virtual bool __thiscall cv::PngDecoder::readHeader(void)" (?readHeader#PngDecoder#cv##UAE_NXZ)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_longjmp_fn referenced in function "public: virtual bool __thiscall cv::PngDecoder::readHeader(void)" (?readHeader#PngDecoder#cv##UAE_NXZ)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_create_info_struct referenced in function "public: virtual bool __thiscall cv::PngDecoder::readHeader(void)" (?readHeader#PngDecoder#cv##UAE_NXZ)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_create_read_struct referenced in function "public: virtual bool __thiscall cv::PngDecoder::readHeader(void)" (?readHeader#PngDecoder#cv##UAE_NXZ)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_read_end referenced in function "public: virtual bool __thiscall cv::PngDecoder::readData(class cv::Mat &)" (?readData#PngDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_read_image referenced in function "public: virtual bool __thiscall cv::PngDecoder::readData(class cv::Mat &)" (?readData#PngDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_read_update_info referenced in function "public: virtual bool __thiscall cv::PngDecoder::readData(class cv::Mat &)" (?readData#PngDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_rgb_to_gray referenced in function "public: virtual bool __thiscall cv::PngDecoder::readData(class cv::Mat &)" (?readData#PngDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_gray_to_rgb referenced in function "public: virtual bool __thiscall cv::PngDecoder::readData(class cv::Mat &)" (?readData#PngDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_bgr referenced in function "public: virtual bool __thiscall cv::PngDecoder::readData(class cv::Mat &)" (?readData#PngDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_expand_gray_1_2_4_to_8 referenced in function "public: virtual bool __thiscall cv::PngDecoder::readData(class cv::Mat &)" (?readData#PngDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_palette_to_rgb referenced in function "public: virtual bool __thiscall cv::PngDecoder::readData(class cv::Mat &)" (?readData#PngDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_strip_alpha referenced in function "public: virtual bool __thiscall cv::PngDecoder::readData(class cv::Mat &)" (?readData#PngDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_swap referenced in function "public: virtual bool __thiscall cv::PngDecoder::readData(class cv::Mat &)" (?readData#PngDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_strip_16 referenced in function "public: virtual bool __thiscall cv::PngDecoder::readData(class cv::Mat &)" (?readData#PngDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_destroy_write_struct referenced in function "public: virtual bool __thiscall cv::PngEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#PngEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_write_end referenced in function "public: virtual bool __thiscall cv::PngEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#PngEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_write_image referenced in function "public: virtual bool __thiscall cv::PngEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#PngEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_write_info referenced in function "public: virtual bool __thiscall cv::PngEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#PngEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_IHDR referenced in function "public: virtual bool __thiscall cv::PngEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#PngEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_compression_strategy referenced in function "public: virtual bool __thiscall cv::PngEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#PngEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_compression_level referenced in function "public: virtual bool __thiscall cv::PngEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#PngEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_filter referenced in function "public: virtual bool __thiscall cv::PngEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#PngEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_compression_mem_level referenced in function "public: virtual bool __thiscall cv::PngEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#PngEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_set_write_fn referenced in function "public: virtual bool __thiscall cv::PngEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#PngEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_png.obj) : error LNK2019: unresolved external symbol _png_create_write_struct referenced in function "public: virtual bool __thiscall cv::PngEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#PngEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_tiff.obj) : error LNK2019: unresolved external symbol _TIFFSetWarningHandler referenced in function "public: __thiscall cv::TiffDecoder::TiffDecoder(void)" (??0TiffDecoder#cv##QAE#XZ)
1>opencv_highgui231d.lib(grfmt_tiff.obj) : error LNK2019: unresolved external symbol _TIFFSetErrorHandler referenced in function "public: __thiscall cv::TiffDecoder::TiffDecoder(void)" (??0TiffDecoder#cv##QAE#XZ)
1>opencv_highgui231d.lib(grfmt_tiff.obj) : error LNK2019: unresolved external symbol _TIFFClose referenced in function "public: void __thiscall cv::TiffDecoder::close(void)" (?close#TiffDecoder#cv##QAEXXZ)
1>opencv_highgui231d.lib(grfmt_tiff.obj) : error LNK2019: unresolved external symbol _TIFFGetField referenced in function "public: virtual bool __thiscall cv::TiffDecoder::readHeader(void)" (?readHeader#TiffDecoder#cv##UAE_NXZ)
1>opencv_highgui231d.lib(grfmt_tiff.obj) : error LNK2019: unresolved external symbol _TIFFOpen referenced in function "public: virtual bool __thiscall cv::TiffDecoder::readHeader(void)" (?readHeader#TiffDecoder#cv##UAE_NXZ)
1>opencv_highgui231d.lib(grfmt_tiff.obj) : error LNK2019: unresolved external symbol _TIFFReadEncodedTile referenced in function "public: virtual bool __thiscall cv::TiffDecoder::readData(class cv::Mat &)" (?readData#TiffDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_tiff.obj) : error LNK2019: unresolved external symbol _TIFFReadEncodedStrip referenced in function "public: virtual bool __thiscall cv::TiffDecoder::readData(class cv::Mat &)" (?readData#TiffDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_tiff.obj) : error LNK2019: unresolved external symbol _TIFFReadRGBATile referenced in function "public: virtual bool __thiscall cv::TiffDecoder::readData(class cv::Mat &)" (?readData#TiffDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_tiff.obj) : error LNK2019: unresolved external symbol _TIFFReadRGBAStrip referenced in function "public: virtual bool __thiscall cv::TiffDecoder::readData(class cv::Mat &)" (?readData#TiffDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_tiff.obj) : error LNK2019: unresolved external symbol _TIFFRGBAImageOK referenced in function "public: virtual bool __thiscall cv::TiffDecoder::readData(class cv::Mat &)" (?readData#TiffDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_tiff.obj) : error LNK2019: unresolved external symbol _TIFFIsTiled referenced in function "public: virtual bool __thiscall cv::TiffDecoder::readData(class cv::Mat &)" (?readData#TiffDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_tiff.obj) : error LNK2019: unresolved external symbol _TIFFWriteScanline referenced in function "protected: bool __thiscall cv::TiffEncoder::writeLibTiff(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?writeLibTiff#TiffEncoder#cv##IAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_tiff.obj) : error LNK2019: unresolved external symbol _TIFFScanlineSize referenced in function "protected: bool __thiscall cv::TiffEncoder::writeLibTiff(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?writeLibTiff#TiffEncoder#cv##IAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_tiff.obj) : error LNK2019: unresolved external symbol _TIFFSetField referenced in function "protected: bool __thiscall cv::TiffEncoder::writeLibTiff(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?writeLibTiff#TiffEncoder#cv##IAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_resync_to_restart referenced in function "void __cdecl cv::jpeg_buffer_src(struct jpeg_decompress_struct *,struct cv::JpegSource *)" (?jpeg_buffer_src#cv##YAXPAUjpeg_decompress_struct##PAUJpegSource#1##Z)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_destroy_decompress referenced in function "public: void __thiscall cv::JpegDecoder::close(void)" (?close#JpegDecoder#cv##QAEXXZ)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_read_header referenced in function "public: virtual bool __thiscall cv::JpegDecoder::readHeader(void)" (?readHeader#JpegDecoder#cv##UAE_NXZ)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_stdio_src referenced in function "public: virtual bool __thiscall cv::JpegDecoder::readHeader(void)" (?readHeader#JpegDecoder#cv##UAE_NXZ)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_CreateDecompress referenced in function "public: virtual bool __thiscall cv::JpegDecoder::readHeader(void)" (?readHeader#JpegDecoder#cv##UAE_NXZ)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_std_error referenced in function "public: virtual bool __thiscall cv::JpegDecoder::readHeader(void)" (?readHeader#JpegDecoder#cv##UAE_NXZ)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_finish_decompress referenced in function "public: virtual bool __thiscall cv::JpegDecoder::readData(class cv::Mat &)" (?readData#JpegDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_read_scanlines referenced in function "public: virtual bool __thiscall cv::JpegDecoder::readData(class cv::Mat &)" (?readData#JpegDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_start_decompress referenced in function "public: virtual bool __thiscall cv::JpegDecoder::readData(class cv::Mat &)" (?readData#JpegDecoder#cv##UAE_NAAVMat#2##Z)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_alloc_huff_table referenced in function "int __cdecl cv::my_jpeg_load_dht(struct jpeg_decompress_struct *,unsigned char *,struct JHUFF_TBL * * const,struct JHUFF_TBL * * const)" (?my_jpeg_load_dht#cv##YAHPAUjpeg_decompress_struct##PAEQAPAUJHUFF_TBL##2#Z)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_destroy_compress referenced in function "public: virtual bool __thiscall cv::JpegEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#JpegEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_finish_compress referenced in function "public: virtual bool __thiscall cv::JpegEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#JpegEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_write_scanlines referenced in function "public: virtual bool __thiscall cv::JpegEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#JpegEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_start_compress referenced in function "public: virtual bool __thiscall cv::JpegEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#JpegEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_set_quality referenced in function "public: virtual bool __thiscall cv::JpegEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#JpegEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_set_defaults referenced in function "public: virtual bool __thiscall cv::JpegEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#JpegEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_stdio_dest referenced in function "public: virtual bool __thiscall cv::JpegEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#JpegEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>opencv_highgui231d.lib(grfmt_jpeg.obj) : error LNK2019: unresolved external symbol _jpeg_CreateCompress referenced in function "public: virtual bool __thiscall cv::JpegEncoder::write(class cv::Mat const &,class std::vector<int,class std::allocator<int> > const &)" (?write#JpegEncoder#cv##UAE_NABVMat#2#ABV?$vector#HV?$allocator#H#std###std###Z)
1>D:\work\SimCapture\OpenCVTest\Debug\OpenCVTest.exe : fatal error LNK1120: 108 unresolved externals
I have a static build of OpenCV with most of the bells and whistles. VC10 OpenCV2.4.9(OCL woo) To fix a very similar problem I just linked to all of the following:
libpng.lib
libtiff.lib
zlib.lib
IlmImf.lib
libjasper.lib
libjpeg.lib
They were inside C:\Lib\opencv249\opencv\bld32\3rdparty\lib\Release
-Not sure which one did it but what the heck. Thanks Loozie!
PK
symbol _imp_CreateToolbarEx#52 referenced in function "int __cdecl icvCreateTrackbar(char const *,char const *,int *,int,void (__cdecl*)(int),void (__cdecl*)(int,void *),void *)" (?icvCreateTrackbar##YAHPBD0PAHHP6AXH#ZP6AXHPAX#Z3#Z)
add comctl32.lib to your linker input.
but after adding all this I still have lots of link errors don't know why...
like
higui.lib(window_w32.obj), _imp_getDCOrfEx#8
higui.lib(window_w32.obj), _imp_getClipBox#8
problem solved.
just add Gdi32.lib and my project goes fine.
to conclude:
1.build your own static lib with cmake.
2.3rd party libs should be added too.
3.windows libs like comctl32.lib, gdi32.lib should be added too.
4.careful check whether the libs(3rd) is complied /MTd mood. I have see LIBCMT.lib and MSVCRT.lib problems.
good luck.
Piecing together several of the other answers that I needed to get this to work, I needed to include this complete list in Linker >> Input >> Additional Dependencies:
opencv_core248d.lib
opencv_imgproc248d.lib
opencv_highgui248d.lib
opencv_ml248d.lib
opencv_video248d.lib
opencv_features2d248d.lib
opencv_calib3d248d.lib
opencv_objdetect248d.lib
opencv_contrib248d.lib
opencv_legacy248d.lib
opencv_flann248d.lib
libpngd.lib
libtiffd.lib
zlibd.lib
IlmImfd.lib
libjasperd.lib
libjpegd.lib
comctl32.lib
gdi32.lib
vfw32.lib
after ensuring that the project's Runtime Library is set to the /MTd option.
This is for Visual Studio 2013
the _avi* ones apparently can be found by linking ("additional dependencies") against
vfw32.lib
For the first 6 errors (_gzputs, etc...), you should to add zlib.lib (or zlibd.lib in Debug configuration) to your linker input.
There are several missing static libs in OpenCV 2.3.1 Windows package. These libraries are usually built as part of OpenCV library and you don't need to install them separately. So you can build OpenCV from sources yourself or use dynamic libraries from the package.
I think you must use the option "Use MFC in a Static Library" to make it work with static libraries.
I have a similiar problem with latest opencv built with Vs 2015 x64,
but after I added these third party libraries( at 3rd party/library/Debug or Release) , the problem was solved.
IlmImfd.lib
libjasperd.lib
libjpegd.lib
libpngd.lib
libtiffd.lib
libwebpd.lib
zlibd.lib