Opened 3 months ago

Closed 3 months ago

#16380 closed defect (fixed)

wx/msw/ownerdrawnbutton.h don't included

Reported by: anhsoft Owned by: VZ
Priority: normal Milestone:
Component: wxMSW Version: dev-latest
Keywords: wxMSWOwnerDrawnButtonBase Cc:
Blocked By: Blocking:
Patch: yes

Description

Compile error occurs when I try to build on MSW platform with minimal configuration, which includes wxControl-derived controls (for this reproduction - the button):

./configure --without-subdirs \
--disable-all-features \
--enable-dynlib \
--enable-dynamicloader \
--enable-image \
--enable-gui \
--enable-ownerdrawn \
--enable-uxtheme \
--enable-menus \
--enable-button

gcc out:

./src/msw/control.cpp:469:1: error: 'wxMSWOwnerDrawnButtonBase' has not been dec
lared
...

Class 'wxMSWOwnerDrawnButtonBase' is defined in wx\msw\ownerdrawnbutton.h and implemented in src\msw\control.cpp, but this header file is included in control.cpp only if the WX_PRECOMP macros isn't defined:

[src/msw/control.cpp]

#ifndef WX_PRECOMP
//skip
    #include "wx/msw/ownerdrawnbutton.h"
#endif

It's causes this error (because WX_PRECOMP isn't defined).

File ownerdrawnbutton.h is also included in two other files: wx\msw\checkbox.h and wx\msw\radiobut.h. Therefore, if configuring was with --enable-checkbox or --enable-radiobtn option, we won't have this error.

The patch makes the following: includes ownerdrawnbutton.h outside the scope of the macro.

Attachments (1)

control.cpp.diff download (581 bytes) - added by anhsoft 3 months ago.

Download all attachments as: .zip

Change History (2)

Changed 3 months ago by anhsoft

comment:1 Changed 3 months ago by VZ

  • Owner set to VZ
  • Resolution set to fixed
  • Status changed from new to closed

In 76929:

Compilation fix for wxMSW build with most features disabled.

Include wx/msw/ownerdrawnbutton.h outside of WX_PRECOMP check to ensure it's
always included.

Closes #16380.

Note: See TracTickets for help on using tickets.