-2

我正在做一项学校作业,我们为此提供了一些 .lib 文件。我将它们添加到链接器中,但仍然出现链接器错误。当我将它们更改为不同的路径时,我得到了一个找不到文件的错误。我的错误是:

Error   53  error LNK2019: unresolved external symbol "__declspec(dllimport)    public: __thiscall sql::SQLString::~SQLString(void)" (__imp_??1SQLString@sql@@QAE@XZ) referenced in function "public: static class std::vector<class Address *,class std::allocator<class Address *> > __cdecl AddressDAO::findAddressByCity(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?findAddressByCity@AddressDAO@@SA?AV?$vector@PAVAddress@@V?$allocator@PAVAddress@@@std@@@std@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@@Z)    C:\Users\Kenny\Documents\software project\Groep 6\Docs\Dev-Branch-Kenny\KiaDealer\KiaDealer\AddressDAO.obj
Error   54  error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall sql::SQLString::~SQLString(void)" (__imp_??1SQLString@sql@@QAE@XZ)  C:\Users\Kenny\Documents\software project\Groep 6\Docs\Dev-Branch-Kenny\KiaDealer\KiaDealer\DatabaseSingleton.obj
Error   55  error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sql::SQLString::SQLString(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_??0SQLString@sql@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: static class std::vector<class Address *,class std::allocator<class Address *> > __cdecl AddressDAO::findAddressByCity(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?findAddressByCity@AddressDAO@@SA?AV?$vector@PAVAddress@@V?$allocator@PAVAddress@@@std@@@std@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@@Z) C:\Users\Kenny\Documents\software project\Groep 6\Docs\Dev-Branch-Kenny\KiaDealer\KiaDealer\AddressDAO.obj
Error   56  error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sql::SQLString::SQLString(char const * const)" (__imp_??0SQLString@sql@@QAE@QBD@Z) referenced in function "public: static class std::vector<class Address *,class std::allocator<class Address *> > __cdecl AddressDAO::findAddressByCity(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?findAddressByCity@AddressDAO@@SA?AV?$vector@PAVAddress@@V?$allocator@PAVAddress@@@std@@@std@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@@Z)   C:\Users\Kenny\Documents\software project\Groep 6\Docs\Dev-Branch-Kenny\KiaDealer\KiaDealer\AddressDAO.obj
Error   57  error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall sql::SQLString::SQLString(char const * const)" (__imp_??0SQLString@sql@@QAE@QBD@Z)  C:\Users\Kenny\Documents\software project\Groep 6\Docs\Dev-Branch-Kenny\KiaDealer\KiaDealer\DatabaseSingleton.obj
Error   58  error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sql::SQLString::operator class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &(void)const " (__imp_??BSQLString@sql@@QBEABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "public: static class std::vector<class Address *,class std::allocator<class Address *> > __cdecl AddressDAO::findAddressByCity(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?findAddressByCity@AddressDAO@@SA?AV?$vector@PAVAddress@@V?$allocator@PAVAddress@@@std@@@std@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@@Z)    C:\Users\Kenny\Documents\software project\Groep 6\Docs\Dev-Branch-Kenny\KiaDealer\KiaDealer\AddressDAO.obj
Error   59  error LNK2019: unresolved external symbol __imp__get_driver_instance referenced in function "private: __thiscall DatabaseSingleton::DatabaseSingleton(void)" (??0DatabaseSingleton@@AAE@XZ) C:\Users\Kenny\Documents\software project\Groep 6\Docs\Dev-Branch-Kenny\KiaDealer\KiaDealer\DatabaseSingleton.obj
Error   60  error LNK1120: 5 unresolved externals   C:\Users\Kenny\Documents\software project\Groep 6\Docs\Dev-Branch-Kenny\KiaDealer\Debug\KiaDealer.exe

我无法编译它。我什至尝试将项目从 unicode 更改为其他选项,因为我读到这解决了某人的这些错误之一的问题。

编辑,我也收到很多这些警告,它们可能是相关的:Warning 1 warning C4251: 'sql::SQLString::realStr' : class 'std::basic_string<_Elem,_Traits,_Alloc>' need to have 'sql::SQLString' 类的客户端使用的 dll 接口 c:\users\kenny\documents\software project\groep 6\docs\dev-branch-kenny\kiadealer\kiadealer\include\cppconn\sqlstring.h 38

4

1 回答 1

1

它确实编译,但它没有链接,有区别。在为您搜索后,您似乎没有为正确的平台进行编译;按照这个线程。进入您的配置管理器并更改您的目标平台。

于 2014-04-26T13:33:06.187 回答