I’m writing a trivia project using c++ with vcpkg.
My project is configured for x86 and I’m also using a vcpkg libraries in x86-Windows.
I have a linker problems that I don’t know how to resolve
here are the errors:
error LNK2019: unresolved external symbol "__declspec(dllimport) public: struct bsoncxx::v_noabi::types::b_utf8 __thiscall bsoncxx::v_noabi::document::element::get_utf8(void)const " (__imp_?get_utf8@element@document@v_noabi@bsoncxx@@QBE?AUb_utf8@types@34@XZ) referenced in function "private: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Mongo::to_str(class bsoncxx::v_noabi::array::element const &)" (?to_str@Mongo@@AAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVelement@array@v_noabi@bsoncxx@@@Z)
error LNK2019: unresolved external symbol "__declspec(dllimport) public: class bsoncxx::v_noabi::document::element __thiscall bsoncxx::v_noabi::document::view::operator[](class boost::basic_string_view<char,struct std::char_traits<char> >)const " (__imp_??Aview@document@v_noabi@bsoncxx@@QBE?AVelement@123@V?$basic_string_view@DU?$char_traits@D@std@@@boost@@@Z) referenced in function "public: virtual class std::set<struct TriviaQuestion,struct std::less<struct TriviaQuestion>,class std::allocator<struct TriviaQuestion> > __thiscall Mongo::getQuestions(int const &)" (?getQuestions@Mongo@@UAE?AV?$set@UTriviaQuestion@@U?$less@UTriviaQuestion@@@std@@V?$allocator@UTriviaQuestion@@@3@@std@@ABH@Z)
error LNK2019: unresolved external symbol "__declspec(dllimport) public: class bsoncxx::v_noabi::array::element const & __thiscall bsoncxx::v_noabi::array::view::const_iterator::operator*(void)" (__imp_??Dconst_iterator@view@array@v_noabi@bsoncxx@@QAEABVelement@234@XZ) referenced in function "public: virtual class std::set<struct TriviaQuestion,struct std::less<struct TriviaQuestion>,class std::allocator<struct TriviaQuestion> > __thiscall Mongo::getQuestions(int const &)" (?getQuestions@Mongo@@UAE?AV?$set@UTriviaQuestion@@U?$less@UTriviaQuestion@@@std@@V?$allocator@UTriviaQuestion@@@3@@std@@ABH@Z)
error LNK2019: unresolved external symbol "__declspec(dllimport) public: class boost::optional<class bsoncxx::v_noabi::document::value> __thiscall mongocxx::v_noabi::collection::find_one(class bsoncxx::v_noabi::view_or_value<class bsoncxx::v_noabi::document::view,class bsoncxx::v_noabi::document::value>,class mongocxx::v_noabi::options::find const &)" (__imp_?find_one@collection@v_noabi@mongocxx@@QAE?AV?$optional@Vvalue@document@v_noabi@bsoncxx@@@boost@@V?$view_or_value@Vview@document@v_noabi@bsoncxx@@Vvalue@234@@2bsoncxx@@ABVfind@options@23@@Z) referenced in function "public: virtual bool __thiscall Mongo::doesPasswordMatch(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 &)" (?doesPasswordMatch@Mongo@@UAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0@Z)
error LNK2019: unresolved external symbol "__declspec(dllimport) public: class boost::optional<class mongocxx::v_noabi::result::insert_one> __thiscall mongocxx::v_noabi::collection::insert_one(class bsoncxx::v_noabi::view_or_value<class bsoncxx::v_noabi::document::view,class bsoncxx::v_noabi::document::value>,class mongocxx::v_noabi::options::insert const &)" (__imp_?insert_one@collection@v_noabi@mongocxx@@QAE?AV?$optional@Vinsert_one@result@v_noabi@mongocxx@@@boost@@V?$view_or_value@Vview@document@v_noabi@bsoncxx@@Vvalue@234@@2bsoncxx@@ABVinsert@options@23@@Z) referenced in function "public: virtual void __thiscall Mongo::addNewUser(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 &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct Address const &,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 &)" (?addNewUser@Mongo@@UAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00ABUAddress@@00@Z)
I tried to reinstall the libraries, reinstall the vcpkg but it didn’t help((