Opened 4 years ago

Closed 4 years 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


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 \

gcc out:

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

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:


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

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 4 years ago.

Download all attachments as: .zip

Change History (2)

Changed 4 years ago by anhsoft

comment:1 Changed 4 years 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.