私はこの問題に完全に困惑していて、この問題を解決する方法を本当に理解することはできません。
基本的に、私はVisual Studio 2010でglooxライブラリをコンパイルし(マイナーな調整で完全に機能しました)、.libファイルと.dllファイルを取得しました。私は今、多くのgloox機能を使用する別のプログラムでこれを使用しようとしています。1つを除いて、ほとんどのシンボルを正常にリンクできます。
1>test.obj : error LNK2001: unresolved external symbol "class
std::basic_string<char,struct std::char_traits<char>,
class std::allocator<char> >
const gloox::EmptyString" (?EmptyString@gloox@@3V?$basic_string@DU?$
char_traits@D@std@@V?$allocator@D@2@@std@@B)
プログラムを詳細にリンクすると、glooxlibの他のすべてのシンボルが正常にリンクされていることがわかります。
1> Searching ..\..\lib\lib\gloox 1.0.lib:
1> Found "public: virtual __thiscall gloox::Message::~Message(void)" (?? 1Message@gloox@@UAE@XZ)
1> Referenced in test.obj
1> Loaded gloox 1.0.lib(gloox 1.0.dll)
1> Found "public: __thiscall gloox::Message::Message(enum gloox::Message::MessageType,class gloox::JID 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 &,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 &)" (??0Message@gloox@@QAE@W4MessageType@01@ABVJID@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@222@Z)
1> Referenced in test.obj
1> Loaded gloox 1.0.lib(gloox 1.0.dll)
1> Found "public: void __thiscall gloox::ClientBase::registerPresenceHandler(class gloox::PresenceHandler *)" (?registerPresenceHandler@ClientBase@gloox@@QAEXPAVPresenceHandler@2@@Z)
1> Referenced in test.obj
1> Loaded gloox 1.0.lib(gloox 1.0.dll)
...
だから私は、シンボルが正しくエクスポートされないかもしれないと思いました、そして私はこれをしました:
dumpbin.exe / exports gloox 1.0.lib
そしてとりわけ私はこれを見ました:
??_FXHtmlIM@gloox@@QAEXXZ (public: void __thiscall gloox::XHtmlIM::`default constructor closure'(void))
?EmptyString@gloox@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@B (class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const gloox::EmptyString)
?GLOOX_CAPS_NODE@gloox@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@B (class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const gloox::GLOOX_CAPS_NODE)
2行目は、シンボルが正常にエクスポートされたことを示しています。
今私が考えることができる唯一の違いは、正しくロードされているシンボルはすべて関数であり、この特定のシンボルは変数であるということです。それでも、エクスポートされた権利がある限り、リンカーはそれを見る必要がありますよね?
どんな助けでも大歓迎です。さらに情報が必要な場合はお知らせください。
ありがとう!