News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

wxPaintDC has initializer but incomplete type

Started by phmb23, July 11, 2014, 11:57:14 PM

Previous topic - Next topic

phmb23

I am new to Code::Blocks and am trying to reproduce an example from the wxSmith tutorial (http://wiki.codeblocks.org/index.php?title=WxSmith_tutorial:_Creating_items_with_custom_paint_and_mouse_handling).

when I compile the program, I get a fatal error:
|116|error: variable 'wxPaintDC dc' has initializer but incomplete type|
  the code referred to is:

void PAintexperimentFrame::OnPanel1Paint(wxPaintEvent& event)
{
    wxPaintDC dc(Panel1);
    dc.drawLine(0,0,100,100);
}

Can anyone help me?

stahta01

Add the line to include the needed header.

This is the likely missing line.

#include <wx/dcclient.h>


Tim S.

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

phmb23