I encountered an issue when I use wxGenericColourDialog with wx2.8.11+vc++2008 under windows.Below code is borrowed from the dialog demo on the wx website.
In "include/wx/msw/setup.h" wxUSE_COLOURDLG is set to 1 when I built wx,but the code can not pass compiler.
the command line of compiling wx is as below:
nmake -f makefile.vc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1
Below is the open menu's event handler:
Code: Select all
#include <wx/colordlg.h>
#include <wx/generic/colrdlgg.h>
#include
oid dialogappFrame::OnChooseColorGenericClick(wxCommandEvent& event)
{
wxColourData m_clrData;
m_clrData.SetColour(myCanvas->GetBackgroundColour());
m_clrData.SetChooseFull(true);
for(int i=0;i<16;i++)
{
wxColor color((unsigned char)(i*16),(unsigned char)(i*16),(unsigned char)(i*16));
m_clrData.SetCustomColour(i,color);
}
wxGenericColourDialog* dialog=new wxGenericColourDialog(this,&m_clrData);
if(dialog->ShowModal()==wxID_OK)
{
m_clrData=dialog->GetColourData();
myCanvas->SetBackgroundColour(m_clrData.GetColour());
myCanvas->ClearBackground();
myCanvas->Refresh();
}
dialog->Destroy();
}
Error Message:
dialogappMain.obj||error LNK2019: unresolved external symbol "public: __thiscall wxGenericColourDialog::wxGenericColourDialog(class wxWindow *,class wxColourData *)" (??0wxGenericColourDialog@@QAE@PAVwxWindow@@PAVwxColourData@@@Z) referenced in function "protected: void __thiscall dialogappFrame::OnChooseColorGenericClick(class wxCommandEvent &)" (?OnChooseColorGenericClick@dialogappFrame@@IAEXAAVwxCommandEvent@@@Z)|
bin\Release\dialogapp.exe||fatal error LNK1120: 1 unresolved externals|
||=== Build finished: 2 errors, 0 warnings (0 minutes, 4 seconds) ===|
I totally have no clue what's wrong here.
Thanks for your help in advance.