I am trying to build a library and getting several "unresolved external symbol" errors. I am trying to fix one of those errors which should give me an idea of how to proceed. That error is: unresolved external symbol IsProcessorFeaturePresent. As per my understanding since this is not part of the code I am trying to build this must be present in a "lib" file. According to this that lib file should be kernel32.lib. Now there are several kernel32.lib files present under "Windows Kits". Which I suppose should be included by default when compiling in Visual Studio Developer Command Prompt as it should be a part of the environment. I still added a path "C:\Program\ Files\ (x86)\Windows\ Kits\8.1\Lib\winv6.3\um\x64" to <library-path> under #requirements in JamFile of the library I have also added "<include>C:\Program\ Files\ (x86)\Windows\ Kits\8.1\Include\um" to it. But there is no change in the error. How do I find out which file does it require to be included?
Note: This question is different from how to resolve unresolved external symbol error, I have already gone through answers to that question and now I am trying to apply it to this particular error.
Edit:I am trying to build the libtorrent library which depends on Boost.Python. I built Boost.Python using --with-python=C:\Python27 in Boost's root directory. After This I have added BOOST_ROOT to the environment variables and also added it to path. After that I am trying to build libtorrent python bindings using bjam variant=release memory-model=64 The complete error logs are here.
Edit 2: Following up on the comments to this question I have added the required libraries to JamFile and the number of errors has been reduced from 187 to 11. The remaining errors are:
create_torrent.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class boost::python::api::object const & __cdecl boost::python::objects::identity_function(void)" (__imp_?identity_function#objects#python#boost##YAAEBVobject#api#23#XZ) referenced in function "class boost::python::api::object __cdecl boost::python::objects::detail::demand_iterator_class<struct `anonymous namespace'::FileIter,struct boost::python::return_value_policy<struct boost::python::return_by_value,struct boost::python::default_call_policies> >(char const *,struct `anonymous namespace'::FileIter *,struct boost::python::return_value_policy<struct boost::python::return_by_value,struct boost::python::default_call_policies> const &)" (??$demand_iterator_class#UFileIter#?A0x1efcf82b##U?$return_value_policy#Ureturn_by_value#python#boost##Udefault_call_policies#23##python#boost###detail#objects#python#boost##YA?AVobject#api#23#PEBDPEAUFileIter#?A0x1efcf82b##AEBU?$return_value_policy#Ureturn_by_value#python#boost##Udefault_call_policies#23##23##Z)
torrent_info.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class boost::python::api::object const & __cdecl boost::python::objects::identity_function(void)" (__imp_?identity_function#objects#python#boost##YAAEBVobject#api#23#XZ)
create_torrent.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl boost::python::objects::stop_iteration_error(void)" (__imp_?stop_iteration_error#objects#python#boost##YAXXZ) referenced in function "struct _object * __cdecl boost::python::detail::invoke<struct boost::python::to_python_value<struct libtorrent::file_entry const &>,struct boost::python::objects::iterator_range<struct boost::python::return_value_policy<struct boost::python::return_by_value,struct boost::python::default_call_policies>,struct `anonymous namespace'::FileIter>::next,struct boost::python::arg_from_python<struct boost::python::objects::iterator_range<struct boost::python::return_value_policy<struct boost::python::return_by_value,struct boost::python::default_call_policies>,struct `anonymous namespace'::FileIter> &> >(struct boost::python::detail::invoke_tag_<0,0>,struct boost::python::to_python_value<struct libtorrent::file_entry const &> const &,struct boost::python::objects::iterator_range<struct boost::python::return_value_policy<struct boost::python::return_by_value,struct boost::python::default_call_policies>,struct `anonymous namespace'::FileIter>::next &,struct boost::python::arg_from_python<struct boost::python::objects::iterator_range<struct boost::python::return_value_policy<struct boost::python::return_by_value,struct boost::python::default_call_policies>,struct `anonymous namespace'::FileIter> &> &)" (??$invoke#U?$to_python_value#AEBUfile_entry#libtorrent###python#boost##Unext#?$iterator_range#U?$return_value_policy#Ureturn_by_value#python#boost##Udefault_call_policies#23##python#boost##UFileIter#?A0x1efcf82b###objects#23#U?$arg_from_python#AEAU?$iterator_range#U?$return_value_policy#Ureturn_by_value#python#boost##Udefault_call_policies#23##python#boost##UFileIter#?A0x1efcf82b###objects#python#boost###23##detail#python#boost##YAPEAU_object##U?$invoke_tag_#$0A#$0A##012#AEBU?$to_python_value#AEBUfile_entry#libtorrent###12#AEAUnext#?$iterator_range#U?$return_value_policy#Ureturn_by_value#python#boost##Udefault_call_policies#23##python#boost##UFileIter#?A0x1efcf82b###objects#12#AEAU?$arg_from_python#AEAU?$iterator_range#U?$return_value_policy#Ureturn_by_value#python#boost##Udefault_call_policies#23##python#boost##UFileIter#?A0x1efcf82b###objects#python#boost###12##Z)
torrent_info.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl boost::python::objects::stop_iteration_error(void)" (__imp_?stop_iteration_error#objects#python#boost##YAXXZ)
session.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::stl_input_iterator_impl(void)" (__imp_??0stl_input_iterator_impl#objects#python#boost##QEAA#XZ) referenced in function "public: __cdecl boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(void)" (??0?$stl_input_iterator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###python#boost##QEAA#XZ)
torrent_handle.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::stl_input_iterator_impl(void)" (__imp_??0stl_input_iterator_impl#objects#python#boost##QEAA#XZ)
session.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::stl_input_iterator_impl(class boost::python::api::object const &)" (__imp_??0stl_input_iterator_impl#objects#python#boost##QEAA#AEBVobject#api#23##Z) referenced in function "public: __cdecl boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(class boost::python::api::object const &)" (??0?$stl_input_iterator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###python#boost##QEAA#AEBVobject#api#12##Z)
torrent_handle.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::stl_input_iterator_impl(class boost::python::api::object const &)" (__imp_??0stl_input_iterator_impl#objects#python#boost##QEAA#AEBVobject#api#23##Z)
session.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl boost::python::objects::stl_input_iterator_impl::increment(void)" (__imp_?increment#stl_input_iterator_impl#objects#python#boost##QEAAXXZ) referenced in function "private: static void __cdecl boost::iterators::iterator_core_access::increment<struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >(struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > &)" (??$increment#U?$stl_input_iterator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###python#boost###iterator_core_access#iterators#boost##CAXAEAU?$stl_input_iterator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###python#2##Z)
torrent_handle.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __cdecl boost::python::objects::stl_input_iterator_impl::increment(void)" (__imp_?increment#stl_input_iterator_impl#objects#python#boost##QEAAXXZ)
session.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __cdecl boost::python::objects::stl_input_iterator_impl::equal(struct boost::python::objects::stl_input_iterator_impl const &)const " (__imp_?equal#stl_input_iterator_impl#objects#python#boost##QEBA_NAEBU1234##Z) referenced in function "bool __cdecl boost::iterators::operator!=<struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::input_iterator_tag,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,__int64,struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::input_iterator_tag,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,__int64>(class boost::iterators::iterator_facade<struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::input_iterator_tag,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,__int64> const &,class boost::iterators::iterator_facade<struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::input_iterator_tag,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,__int64> const &)" (??$?9U?$stl_input_iterator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###python#boost##V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##Uinput_iterator_tag#4#V34#_JU012#V34#U54#V34#_J#iterators#boost##YA_NAEBV?$iterator_facade#U?$stl_input_iterator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###python#boost##V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##Uinput_iterator_tag#5#V45#_J#01#0#Z)
torrent_handle.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __cdecl boost::python::objects::stl_input_iterator_impl::equal(struct boost::python::objects::stl_input_iterator_impl const &)const " (__imp_?equal#stl_input_iterator_impl#objects#python#boost##QEBA_NAEBU1234##Z)
session.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class boost::python::handle<struct _object> const & __cdecl boost::python::objects::stl_input_iterator_impl::current(void)const " (__imp_?current#stl_input_iterator_impl#objects#python#boost##QEBAAEBV?$handle#U_object###34#XZ) referenced in function "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl boost::iterators::iterator_core_access::dereference<struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >(struct boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > const &)" (??$dereference#U?$stl_input_iterator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###python#boost###iterator_core_access#iterators#boost##CA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##AEBU?$stl_input_iterator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###python#2##Z)
torrent_handle.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class boost::python::handle<struct _object> const & __cdecl boost::python::objects::stl_input_iterator_impl::current(void)const " (__imp_?current#stl_input_iterator_impl#objects#python#boost##QEBAAEBV?$handle#U_object###34#XZ)
session.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::~stl_input_iterator_impl(void)" (__imp_??1stl_input_iterator_impl#objects#python#boost##QEAA#XZ) referenced in function "public: __cdecl boost::python::stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::~stl_input_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(void)" (??1?$stl_input_iterator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###python#boost##QEAA#XZ)
torrent_handle.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::~stl_input_iterator_impl(void)" (__imp_??1stl_input_iterator_impl#objects#python#boost##QEAA#XZ)
torrent_handle.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: struct boost::python::detail::dict_base & __cdecl boost::python::detail::dict_base::operator=(struct boost::python::detail::dict_base &&)" (__imp_??4dict_base#detail#python#boost##QEAAAEAU0123#$$QEAU0123##Z) referenced in function "public: class boost::python::dict & __cdecl boost::python::dict::operator=(class boost::python::dict &&)" (??4dict#python#boost##QEAAAEAV012#$$QEAV012##Z)
torrent_handle.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::stl_input_iterator_impl(struct boost::python::objects::stl_input_iterator_impl const &)" (__imp_??0stl_input_iterator_impl#objects#python#boost##QEAA#AEBU0123##Z) referenced in function "public: __cdecl std::vector<int,class std::allocator<int> >::vector<int,class std::allocator<int> ><struct boost::python::stl_input_iterator<int const >,void>(struct boost::python::stl_input_iterator<int const >,struct boost::python::stl_input_iterator<int const >,class std::allocator<int> const &)" (??$?0U?$stl_input_iterator#$$CBH#python#boost##X#?$vector#HV?$allocator#H#std###std##QEAA#U?$stl_input_iterator#$$CBH#python#boost##0AEBV?$allocator#H#1##Z)
torrent_handle.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl boost::python::objects::stl_input_iterator_impl::stl_input_iterator_impl(struct boost::python::objects::stl_input_iterator_impl &&)" (__imp_??0stl_input_iterator_impl#objects#python#boost##QEAA#$$QEAU0123##Z) referenced in function "public: __cdecl std::vector<int,class std::allocator<int> >::vector<int,class std::allocator<int> ><struct boost::python::stl_input_iterator<int const >,void>(struct boost::python::stl_input_iterator<int const >,struct boost::python::stl_input_iterator<int const >,class std::allocator<int> const &)" (??$?0U?$stl_input_iterator#$$CBH#python#boost##X#?$vector#HV?$allocator#H#std###std##QEAA#U?$stl_input_iterator#$$CBH#python#boost##0AEBV?$allocator#H#1##Z)
bin\msvc-14.1\release\address-model-64\libtorrent.dll : fatal error LNK1120: 11 unresolved externals
On inspection of libboost_python-vc141-mt-1_65_1.lib at C:\boost_1_65_1\stage\lib (using dumpbin /EXPORTS) I checked that all the symbols are present in the output of dumpbin, for example searching for identity_function I get this line:
06B 00000000 SECT28 notype () External | ?identity_function#objects#python#boost##YAAEBVobject#api#23#XZ (class boost::python::api::object const & __cdecl boost::python::objects::identity_function(void))
I am including this lib file in my JamFile. What else am I missing? Is there some option I need to pass while building Boost.Python currently I am building it using bjam --with-python variant=release address-model=64
Following RbMm's suggestion I included the libaries in the JamFile and it removed a lot of unresolved external symbol errors. The rest of the errors were fixed by building Boost.Python as shared and including the lib file. Now I have a completely different unrelated error.
Related
I created a test console exe project to test my program in VS2008!
Linked gtestd.lib to that project with following code
MAIN
#include "gtest/gtest.h"
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
return this linker errors:
1>gtestd.lib(gtest-all.obj) : error LNK2019: unresolved external symbol ___report_rangecheckfailure referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl testing::internal::CodePointToUtf8(unsigned int)" (?CodePointToUtf8#internal#testing##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##I#Z)
1>gtestd.lib(gtest-all.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base12::_Container_base12(void)" (__imp_??0_Container_base12#std##QAE#XZ) referenced in function "public: __thiscall std::_String_val<struct std::_Simple_types<char> >::_String_val<struct std::_Simple_types<char> >(void)" (??0?$_String_val#U?$_Simple_types#D#std###std##QAE#XZ)
1>gtestd.lib(gtest-all.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall std::_Container_base12::~_Container_base12(void)" (__imp_??1_Container_base12#std##QAE#XZ) referenced in function "public: __thiscall std::_String_val<struct std::_Simple_types<char> >::~_String_val<struct std::_Simple_types<char> >(void)" (??1?$_String_val#U?$_Simple_types#D#std###std##QAE#XZ)
1>gtestd.lib(gtest-all.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: struct std::_Iterator_base12 * * __thiscall std::_Container_base12::_Getpfirst(void)const " (__imp_?_Getpfirst#_Container_base12#std##QBEPAPAU_Iterator_base12#2#XZ) referenced in function "protected: void __thiscall std::_Tree<class std::_Tset_traits<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,0> >::_Orphan_ptr(class std::_Tree<class std::_Tset_traits<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,0> > &,struct std::_Tree_node<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,void *> *)const " (?_Orphan_ptr#?$_Tree#V?$_Tset_traits#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##U?$less#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2#V?$allocator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2#$0A##std###std##IBEXAAV12#PAU?$_Tree_node#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##PAX#2##Z)
1>gtestd.lib(gtest-all.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base12::_Orphan_all(void)" (__imp_?_Orphan_all#_Container_base12#std##QAEXXZ) referenced in function __catch$??$_Insert#PBQBD#?$vector#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##V?$allocator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2##std##QAEXV?$_Vector_const_iterator#V?$_Vector_val#U?$_Simple_types#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###std###std###1#PBQBD1Uforward_iterator_tag#1##Z$0
1>gtestd.lib(gtest-all.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::_Container_base12::_Swap_all(struct std::_Container_base12 &)" (__imp_?_Swap_all#_Container_base12#std##QAEXAAU12##Z) referenced in function "?_Assign_rv#?$vector#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##V?$allocator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2##std##QAEX$$QAV12##Z" (?_Assign_rv#?$vector#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##V?$allocator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2##std##QAEX$$QAV12##Z)
1>gtestd.lib(gtest-all.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Xbad_alloc(void)" (__imp_?_Xbad_alloc#std##YAXXZ) referenced in function "char * __cdecl std::_Allocate<char>(unsigned int,char *)" (??$_Allocate#D#std##YAPADIPAD#Z)
1>gtestd.lib(gtest-all.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Xlength_error(char const *)" (__imp_?_Xlength_error#std##YAXPBD#Z) referenced in function "protected: class std::_Tree_const_iterator<class std::_Tree_val<struct std::_Tree_simple_types<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > > __thiscall std::_Tree<class std::_Tset_traits<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct std::less<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >,0> >::_Insert_at<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct std::_Nil>(bool,struct std::_Tree_node<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,void *> *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct std::_Nil)" (??$_Insert_at#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##U_Nil#2##?$_Tree#V?$_Tset_traits#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##U?$less#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2#V?$allocator#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###2#$0A##std###std##IAE?AV?$_Tree_const_iterator#V?$_Tree_val#U?$_Tree_simple_types#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###std###std###1#_NPAU?$_Tree_node#V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##PAX#1#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##1#U_Nil#1##Z)
1>gtestd.lib(gtest-all.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Xout_of_range(char const *)" (__imp_?_Xout_of_range#std##YAXPBD#Z) referenced in function "public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Xran(void)const " (?_Xran#?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##QBEXXZ)
1>gtestd.lib(gtest-all.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) char const * __cdecl std::_Syserror_map(int)" (__imp_?_Syserror_map#std##YAPBDH#Z) referenced in function "public: virtual class std::error_condition __thiscall std::_System_error_category::default_error_condition(int)const " (?default_error_condition#_System_error_category#std##UBE?AVerror_condition#2#H#Z)
1>gtestd.lib(gtest-all.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) char const * __cdecl std::_Winerror_map(int)" (__imp_?_Winerror_map#std##YAPBDH#Z) referenced in function "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::_System_error_category::message(int)const " (?message#_System_error_category#std##UBE?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##2#H#Z)
1>gtestd.lib(gtest-all.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __int64 __thiscall std::ios_base::width(void)const " (__imp_?width#ios_base#std##QBE_JXZ) referenced in function "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??$?6DU?$char_traits#D#std##V?$allocator#D#1##std##YAAAV?$basic_ostream#DU?$char_traits#D#std###0#AAV10#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##0##Z)
Notes:
compiled all projects with MD or MD(d)
at the moment no tests defined (only main)
Anything still wrong here? Thanks for any help!
Ok, I found the solution for VS2012:
use the gtest-md solution file if your other projects are compiled with /md
set _VARIADIC_MAX=10 as preprocessor definition
maybe you have to change the compiler to VS2008 if your project-to-test also use this compiler
Greets
Im a C++ and VS noob. Im trying to learn the CS 106b course(Link to course page) by Stanford for programming using C++. However, Im running into a few issues as I try to setup the startup code.
For instance, the following code,
#include <iostream>
#include "graphics.h"
using namespace std;
int main(){
initGraphics();
setColor("BLUE");
fillRect(50,50,300,150);
setFont("Times New Roman");
setColor("WHITE");
drawString("Hello World Graphically!!",60,140);
return 0;
}
compiles successfully, but throws the following linker errors.
1>------ Build started: Project: HellowWorld, Configuration: Release Win32 ------
1>Hello.obj : error LNK2005: _main already defined in GraphicsHelloWorld.obj
1>StanfordCPPLib.lib(startup.obj) : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
.......
width#ios_base#std##QBEHXZ)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::ios_base::width(void)const " (__imp_?width#ios_base#std##QBEHXZ)
1>StanfordCPPLib.lib(pcgraphics.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::ios_base::width(void)const " (__imp_?width#ios_base#std##QBEHXZ)
1>StanfordCPPLib.lib(gtypes.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::ios_base::width(void)const " (__imp_?width#ios_base#std##QBEHXZ)
1>StanfordCPPLib.lib(error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (__imp_?_Lock#?$basic_streambuf#DU?$char_traits#D#std###std##QAEXXZ)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (__imp_?_Lock#?$basic_streambuf#DU?$char_traits#D#std###std##QAEXXZ)
1>StanfordCPPLib.lib(pcgraphics.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (__imp_?_Lock#?$basic_streambuf#DU?$char_traits#D#std###std##QAEXXZ)
1>StanfordCPPLib.lib(gtypes.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (__imp_?_Lock#?$basic_streambuf#DU?$char_traits#D#std###std##QAEXXZ)
1>StanfordCPPLib.lib(error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Unlock(void)" (__imp_?_Unlock#?$basic_streambuf#DU?$char_traits#D#std###std##QAEXXZ)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Unlock(void)" (__imp_?_Unlock#?$basic_streambuf#DU?$char_traits#D#std###std##QAEXXZ)
1>StanfordCPPLib.lib(pcgraphics.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Unlock(void)" (__imp_?_Unlock#?$basic_streambuf#DU?$char_traits#D#std###std##QAEXXZ)
1>StanfordCPPLib.lib(gtypes.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Unlock(void)" (__imp_?_Unlock#?$basic_streambuf#DU?$char_traits#D#std###std##QAEXXZ)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_istringstream<char,struct std::char_traits<char>,class std::allocator<char> >::`vbase destructor'(void)" (__imp_??_D?$basic_istringstream#DU?$char_traits#D#std##V?$allocator#D#2##std##QAEXXZ)
1>StanfordCPPLib.lib(strlib.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_istringstream<char,struct std::char_traits<char>,class std::allocator<char> >::`vbase destructor'(void)" (__imp_??_D?$basic_istringstream#DU?$char_traits#D#std##V?$allocator#D#2##std##QAEXXZ)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_istream<char,struct std::char_traits<char> > & __cdecl std::operator>><char,struct std::char_traits<char> >(class std::basic_istream<char,struct std::char_traits<char> > &,char &)" (__imp_??$?5DU?$char_traits#D#std###std##YAAAV?$basic_istream#DU?$char_traits#D#std###0#AAV10#AAD#Z)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_istringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_istringstream<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (__imp_??0?$basic_istringstream#DU?$char_traits#D#std##V?$allocator#D#2##std##QAE#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##1#H#Z)
1>StanfordCPPLib.lib(strlib.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_istringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_istringstream<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" (__imp_??0?$basic_istringstream#DU?$char_traits#D#std##V?$allocator#D#2##std##QAE#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##1#H#Z)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::operator+<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,char const *)" (__imp_??$?HDU?$char_traits#D#std##V?$allocator#D#1##std##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##0#ABV10#PBD#Z)
1>StanfordCPPLib.lib(gtypes.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::operator+<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,char const *)" (__imp_??$?HDU?$char_traits#D#std##V?$allocator#D#1##std##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##0#ABV10#PBD#Z)
1>StanfordCPPLib.lib(strlib.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::operator+<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,char const *)" (__imp_??$?HDU?$char_traits#D#std##V?$allocator#D#1##std##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##0#ABV10#PBD#Z)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::substr(unsigned int,unsigned int)const " (__imp_?substr#?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##QBE?AV12#II#Z)
1>StanfordCPPLib.lib(strlib.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::substr(unsigned int,unsigned int)const " (__imp_?substr#?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##QBE?AV12#II#Z)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: char & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator[](unsigned int)" (__imp_??A?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##QAEAADI#Z)
1>StanfordCPPLib.lib(pcgraphics.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: char & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator[](unsigned int)" (__imp_??A?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##QAEAADI#Z)
1>StanfordCPPLib.lib(strlib.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: char & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator[](unsigned int)" (__imp_??A?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##QAEAADI#Z)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator==<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,char const *)" (__imp_??$?8DU?$char_traits#D#std##V?$allocator#D#1##std##YA_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##0#PBD#Z)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::`vbase destructor'(void)" (__imp_??_D?$basic_ostringstream#DU?$char_traits#D#std##V?$allocator#D#2##std##QAEXXZ)
1>StanfordCPPLib.lib(gtypes.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::`vbase destructor'(void)" (__imp_??_D?$basic_ostringstream#DU?$char_traits#D#std##V?$allocator#D#2##std##QAEXXZ)
1>StanfordCPPLib.lib(strlib.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::`vbase destructor'(void)" (__imp_??_D?$basic_ostringstream#DU?$char_traits#D#std##V?$allocator#D#2##std##QAEXXZ)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(void)const " (__imp_?str#?$basic_ostringstream#DU?$char_traits#D#std##V?$allocator#D#2##std##QBE?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##2#XZ)
1>StanfordCPPLib.lib(gtypes.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(void)const " (__imp_?str#?$basic_ostringstream#DU?$char_traits#D#std##V?$allocator#D#2##std##QBE?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##2#XZ)
1>StanfordCPPLib.lib(strlib.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(void)const " (__imp_?str#?$basic_ostringstream#DU?$char_traits#D#std##V?$allocator#D#2##std##QBE?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##2#XZ)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) struct std::_Smanip<int> __cdecl std::setw(int)" (__imp_?setw#std##YA?AU?$_Smanip#H#1#H#Z)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >(int)" (__imp_??0?$basic_ostringstream#DU?$char_traits#D#std##V?$allocator#D#2##std##QAE#H#Z)
1>StanfordCPPLib.lib(gtypes.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >(int)" (__imp_??0?$basic_ostringstream#DU?$char_traits#D#std##V?$allocator#D#2##std##QAE#H#Z)
1>StanfordCPPLib.lib(strlib.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >(int)" (__imp_??0?$basic_ostringstream#DU?$char_traits#D#std##V?$allocator#D#2##std##QAE#H#Z)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator+=(char)" (__imp_??Y?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##QAEAAV01#D#Z)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::length(void)const " (__imp_?length#?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##QBEIXZ)
1>StanfordCPPLib.lib(pcgraphics.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::length(void)const " (__imp_?length#?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##QBEIXZ)
1>StanfordCPPLib.lib(strlib.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::length(void)const " (__imp_?length#?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##QBEIXZ)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??$?MDU?$char_traits#D#std##V?$allocator#D#1##std##YA_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##0#0#Z)
1>StanfordCPPLib.lib(gwindow.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator==<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??$?8DU?$char_traits#D#std##V?$allocator#D#1##std##YA_NABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##0#0#Z)
1>StanfordCPPLib.lib(pcgraphics.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::operator=(char const *)" (__imp_??4?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##QAEAAV01#PBD#Z)
1>StanfordCPPLib.lib(gtypes.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::operator+<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??$?HDU?$char_traits#D#std##V?$allocator#D#1##std##YA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##0#ABV10#0#Z)
1>D:\C++Projects\HellowWorld\Release\HellowWorld.exe : fatal error LNK1120: 28 unresolved externals
By the way I have stored the path to the external StanfordCPPLib.lib by editing the path through Project->Properties->Linker->Additional Dependencies->D:\C++Projects\HellowWorld\HellowWorld\StanfordCPPLib.cpp and added the Additional header files through Project->Properties->C/C++->Additional Include Directories->C:\Users\Vivek\Downloads\Assignment1-vs2008\StanfordCPPLib\include
Both the folders are present in their location. Any tips on what Im doing wrong here would be helpful!
I m using taglib for one of my projects . The Debug/Release library is build using MSVC 10. On compiling the code with the library in taglib/taglib/Release some linker error are thrown .
id3.cpp.1.o : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class TagLib::AudioPropertie
s * __cdecl TagLib::FileRef::audioProperties(void)const " (__imp_?audioProperties#FileRef#TagLib##QEBAPEAVAudioProp
erties#2#XZ) referenced in function "struct MetaData __cdecl ID3::getMetaDataOfFile(class std::basic_string<char,st
ruct std::char_traits<char>,class std::allocator<char> >)" (?getMetaDataOfFile#ID3##YA?AUMetaData##V?$basic_string#
DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
id3.cpp.1.o : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl TagLib::Stri
ng::~String(void)" (__imp_??1String#TagLib##UEAA#XZ) referenced in function "struct MetaData __cdecl ID3::getMetaDa
taOfFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?getMetaDataOfF
ile#ID3##YA?AUMetaData##V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
id3.cpp.1.o : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char
,struct std::char_traits<char>,class std::allocator<char> > __cdecl TagLib::String::to8Bit(bool)const " (__imp_?to8
Bit#String#TagLib##QEBA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##_N#Z) referenced in function
"struct MetaData __cdecl ID3::getMetaDataOfFile(class std::basic_string<char,struct std::char_traits<char>,class s
td::allocator<char> >)" (?getMetaDataOfFile#ID3##YA?AUMetaData##V?$basic_string#DU?$char_traits#D#std##V?$allocator
#D#2##std###Z)
id3.cpp.1.o : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl TagLib::File
Ref::~FileRef(void)" (__imp_??1FileRef#TagLib##UEAA#XZ) referenced in function "struct MetaData __cdecl ID3::getMet
aDataOfFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?getMetaData
OfFile#ID3##YA?AUMetaData##V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
id3.cpp.1.o : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class TagLib::Tag * __cdecl
TagLib::FileRef::tag(void)const " (__imp_?tag#FileRef#TagLib##QEBAPEAVTag#2#XZ) referenced in function "struct Meta
Data __cdecl ID3::getMetaDataOfFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator
<char> >)" (?getMetaDataOfFile#ID3##YA?AUMetaData##V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z
)
id3.cpp.1.o : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __cdecl TagLib::FileRef
::isNull(void)const " (__imp_?isNull#FileRef#TagLib##QEBA_NXZ) referenced in function "struct MetaData __cdecl ID3:
:getMetaDataOfFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?getM
etaDataOfFile#ID3##YA?AUMetaData##V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
id3.cpp.1.o : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl TagLib::FileRef::Fil
eRef(class TagLib::FileName,bool,enum TagLib::AudioProperties::ReadStyle)" (__imp_??0FileRef#TagLib##QEAA#VFileName
#1#_NW4ReadStyle#AudioProperties#1##Z) referenced in function "struct MetaData __cdecl ID3::getMetaDataOfFile(class
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?getMetaDataOfFile#ID3##YA?AU
MetaData##V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
id3.cpp.1.o : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl TagLib::FileName::Fi
leName(char const *)" (__imp_??0FileName#TagLib##QEAA#PEBD#Z) referenced in function "struct MetaData __cdecl ID3::
getMetaDataOfFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?getMe
taDataOfFile#ID3##YA?AUMetaData##V?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
I m only including tag.lib from taglib/taglib/Release folder . Is there some other library I m missing out?
I converted a perfectly working Managed C++ DLL project that uses Unmanaged C++ LIBs from VS2008 to VS2010. Beforehand I separately rebuilt the LIBs with VS2010 (they are part of another project that I have no authority over). However, after conversion my managed DLL project stopped linking giving me few dosen of LNK2001 error messages (see the sample below). All errors about "std" entities defined within "string" and "iosfwd" headers. Which compiler/linker settings am I missing?
Thanks in advance for your help.
Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) bool __cdecl std::operator!=<char,struct std::char_traits<char>,class td::allocator<char> >(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,char const *)" (__imp_??$?9DU?$char_traits#D#std##V?$allocator#D#1##std##YA_NAEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##0#PEBD#Z)
Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??$?6DU?$char_traits#D#std##V?$allocator#D#1##std##YAAEAV?$basic_ostream#DU?$char_traits#D#std###0#AEAV10#AEBV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##0##Z)
Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned __int64 const std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::npos" (__imp_?npos#?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##2_KB)
Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (__imp_?_Lock#?$basic_streambuf#DU?$char_traits#D#std###std##QEAAXXZ)
Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __cdecl std::basic_streambuf<char,struct std::char_traits<char> >::_Unlock(void)" (__imp_?_Unlock#?$basic_streambuf#DU?$char_traits#D#std###std##QEAAXXZ)
Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::str(void)const " (__imp_?str#?$basic_ostringstream#DU?$char_traits#D#std##V?$allocator#D#2##std##QEBA?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##2#XZ)
Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >::basic_ostringstream<char,struct std::char_traits<char>,class std::allocator<char> >(int)" (__imp_??0?$basic_ostringstream#DU?$char_traits#D#std##V?$allocator#D#2##std##QEAA#H#Z)
Auxiliary.lib(Error.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::substr(unsigned __int64,unsigned __int64)const " (__imp_?substr#?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##QEBA?AV12#_K0#Z)
etc...
Finally found it (thanks Hans Passant for the tip!) I had a few files that were still built by VS2008 and that caused the issue. Thanks to everyone who bothered to add a comment.
I use cmake for building my project files.
this are my additional link libraries:
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
comdlg32.lib
advapi32.lib
..\boost\Debug\boost_lib_thread.lib
..\boost\Debug\boost_lib_system.lib
..\global\Debug\global.lib
C:\Program Files (x86)\OpenSSL-Win32\lib\VC\libeay32MD.lib
C:\Program Files (x86)\OpenSSL-Win32\lib\VC\ssleay32MDd.lib
C:\Program Files (x86)\OpenSSL-Win32\lib\VC\libeay32MDd.lib
C:\Program Files\MySQL\MySQL Server 5.5\lib\libmysql.lib
I get following errors when i try to compile:
1>global.lib(DatabaseSystem.obj) : error LNK2019: unresolved external symbol _mysql_close#4 referenced in function "public: virtual __thiscall Database::~Database(void)" (??1Database##UAE#XZ)
1>global.lib(DatabaseSystem.obj) : error LNK2019: unresolved external symbol _mysql_error#4 referenced in function "public: bool __thiscall Database::InitDB(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned long,unsigned long)" (?InitDB#Database##QAE_NV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##I000KK#Z)
1>global.lib(DatabaseSystem.obj) : error LNK2019: unresolved external symbol _mysql_real_connect#32 referenced in function "public: bool __thiscall Database::InitDB(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned long,unsigned long)" (?InitDB#Database##QAE_NV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##I000KK#Z)
1>global.lib(DatabaseSystem.obj) : error LNK2019: unresolved external symbol _mysql_options#12 referenced in function "public: bool __thiscall Database::InitDB(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned long,unsigned long)" (?InitDB#Database##QAE_NV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##I000KK#Z)
1>global.lib(DatabaseSystem.obj) : error LNK2019: unresolved external symbol _mysql_init#4 referenced in function "public: bool __thiscall Database::InitDB(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,unsigned long,unsigned long)" (?InitDB#Database##QAE_NV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##I000KK#Z)
1>global.lib(DatabaseSystem.obj) : error LNK2019: unresolved external symbol _mysql_real_escape_string#16 referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Database::EscapeString(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?EscapeString#Database##QAE?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##V23##Z)
1>global.lib(DatabaseSystem.obj) : error LNK2019: unresolved external symbol _mysql_errno#4 referenced in function "protected: bool __thiscall Database::_SendQuery(struct DatabaseConnection *,char const *,bool)" (?_SendQuery#Database##IAE_NPAUDatabaseConnection##PBD_N#Z)
1>global.lib(DatabaseSystem.obj) : error LNK2019: unresolved external symbol _mysql_query#8 referenced in function "protected: bool __thiscall Database::_SendQuery(struct DatabaseConnection *,char const *,bool)" (?_SendQuery#Database##IAE_NPAUDatabaseConnection##PBD_N#Z)
1>global.lib(DatabaseSystem.obj) : error LNK2019: unresolved external symbol _mysql_free_result#4 referenced in function "public: __thiscall QueryResult::~QueryResult(void)" (??1QueryResult##QAE#XZ)
1>global.lib(DatabaseSystem.obj) : error LNK2019: unresolved external symbol _mysql_fetch_row#4 referenced in function "public: bool __thiscall QueryResult::NextRow(void)" (?NextRow#QueryResult##QAE_NXZ)
1>global.lib(DatabaseSystem.obj) : error LNK2019: unresolved external symbol _mysql_field_count#4 referenced in function "protected: class QueryResult * __thiscall Database::_StoreQueryResult(struct DatabaseConnection *)" (?_StoreQueryResult#Database##IAEPAVQueryResult##PAUDatabaseConnection###Z)
1>global.lib(DatabaseSystem.obj) : error LNK2019: unresolved external symbol _mysql_affected_rows#4 referenced in function "protected: class QueryResult * __thiscall Database::_StoreQueryResult(struct DatabaseConnection *)" (?_StoreQueryResult#Database##IAEPAVQueryResult##PAUDatabaseConnection###Z)
1>global.lib(DatabaseSystem.obj) : error LNK2019: unresolved external symbol _mysql_store_result#4 referenced in function "protected: class QueryResult * __thiscall Database::_StoreQueryResult(struct DatabaseConnection *)" (?_StoreQueryResult#Database##IAEPAVQueryResult##PAUDatabaseConnection###Z)
1>global.lib(DatabaseSystem.obj) : error LNK2019: unresolved external symbol _mysql_server_end#0 referenced in function "public: static void __cdecl Database::CleanupLibs(void)" (?CleanupLibs#Database##SAXXZ)
1>C:\Users\FreakX\Desktop\FrostCore2\build\source\authserver\Debug\AuthServer.exe : fatal error LNK1120: 14 unresolved externals
Try adding libmysqlpp in addition to libmysql. This is the C++ API, which from the linker errors you do appear to be trying to use.