-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

コンパイルできません。プロジェクトをユニコードから他のオプションに変更しようとさえしました。これは、これらのエラーのいずれかで誰かの問題を修正したことを読んだからです。

編集、おそらく関連するこれらの警告もたくさん表示されます。クラス「sql::SQLString」のクライアントが使用する dll-interface 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 に答える