Page 1 of 1

wxwidgets用vc6.0编译的问题

Posted: Wed May 19, 2010 3:13 pm
by wubi
我用wxwidgets写了一个小程序的,用到数据库。我是用ODBC连接的。
我在工程中添加了wxbase28d_odbc.lib。什么原因。是不是还缺少什么lib?
编译结果如下:
--------------------Configuration: wx_dll_test - Win32 Debug--------------------
Linking...
main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall wxDbTable::Open(bool,bool)" (?Open@wxDbTable@@QAE_N_N0@Z)
main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall wxDbTable::SetColDefs(unsigned short,class wxString const &,int,void *,short,int,bool,bool,bool,bool)" (?SetColDefs@wxDbTable@@QAE_NGABVwxString@@HPAXFH_N222@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall wxDbTable::wxDbTable(class wxDb *,class wxString const &,unsigned short,class wxString const &,bool,class wxString const &)" (??0wxDbTable@@QAE@PAVwxDb@@ABVwxString@@G1_N1@Z)
main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall wxDb::CommitTrans(void)" (?CommitTrans@wxDb@@QAE_NXZ)
main.obj : error LNK2001: unresolved external symbol "public: int __thiscall wxDbTable::Insert(void)" (?Insert@wxDbTable@@QAEHXZ)
main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall wxDbTable::DeleteWhere(class wxString const &)" (?DeleteWhere@wxDbTable@@QAE_NABVwxString@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall wxDbConnectInf::~wxDbConnectInf(void)" (??1wxDbConnectInf@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall wxDb::Open(class wxDbConnectInf *,bool)" (?Open@wxDb@@QAE_NPAVwxDbConnectInf@@_N@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall wxDb::wxDb(void * const &,bool)" (??0wxDb@@QAE@ABQAX_N@Z)
main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall wxDbConnectInf::AllocHenv(void)" (?AllocHenv@wxDbConnectInf@@QAE_NXZ)
main.obj : error LNK2001: unresolved external symbol "public: void __thiscall wxDbConnectInf::SetConnectionStr(class wxString const &)" (?SetConnectionStr@wxDbConnectInf@@QAEXABVwxString@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall wxDbConnectInf::wxDbConnectInf(void)" (??0wxDbConnectInf@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "private: bool __thiscall wxDbTable::getRec(unsigned short)" (?getRec@wxDbTable@@AAE_NG@Z)
Debug/wx_dll_test.exe : fatal error LNK1120: 13 unresolved externals
执行 link.exe 时出错.

wx_dll_test.exe - 1 error(s), 0 warning(s)

Posted: Thu May 20, 2010 9:39 am
by kingkamg
把wx所有的库都包含一遍不就知道是不是缺库了

Re: wxwidgets用vc6.0编译的问题

Posted: Thu May 20, 2010 10:21 am
by sishui
编译wx库的时候,wxUSE_ODBC是否设置成1?

Posted: Thu May 27, 2010 11:31 am
by wubi
谢谢,我已经解决了。是wxUse_ODBC没有设为1