Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: ‘wxFont::wxFont(int, int, int, int, bool, const wxString&, wxFontEncoding)’ is deprecated #220

Open
zen2 opened this issue Jun 17, 2024 · 2 comments

Comments

@zen2
Copy link

zen2 commented Jun 17, 2024

I got an error at compilation time because of the following deprecated function using wxWidgets-3.0.4:

error: ‘wxFont::wxFont(int, int, int, int, bool, const wxString&, wxFontEncoding)’ is deprecated: use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants [-Werror=deprecated-declarations]

The accurate compilation error:

[35/42] /usr/bin/x86_64-pc-linux-gnu-g++ -DBOOKMARKS_EDITOR -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CHRONO_DYN_LINK -DBOOST_CHRONO_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_LOG_DYN_LINK -DBOOST_LOG_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8/include -I/var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8/src -I/var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8_build -I/usr/include/jsoncpp -I/var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8/src/radiotray-ng/gui/editor/rtng-bookmark-editor -isystem /usr/lib64/wx/include/gtk3-unicode-3.2-gtk3 -isystem /usr/include/wx-3.2-gtk3  -O2 -pipe -march=native -Wall -Wextra -Werror -Wpedantic -pthread -std=gnu++14 -fdiagnostics-color=auto -MD -MT src/radiotray-ng/gui/editor/CMakeFiles/rtng-bookmark-editor.dir/station_drop_target.cpp.o -MF src/radiotray-ng/gui/editor/CMakeFiles/rtng-bookmark-editor.dir/station_drop_target.cpp.o.d -o src/radiotray-ng/gui/editor/CMakeFiles/rtng-bookmark-editor.dir/station_drop_target.cpp.o -c /var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8/src/radiotray-ng/gui/editor/station_drop_target.cpp
FAILED: src/radiotray-ng/gui/editor/CMakeFiles/rtng-bookmark-editor.dir/station_drop_target.cpp.o
/usr/bin/x86_64-pc-linux-gnu-g++ -DBOOKMARKS_EDITOR -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CHRONO_DYN_LINK -DBOOST_CHRONO_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_LOG_DYN_LINK -DBOOST_LOG_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DWXUSINGDLL -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -I/var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8/include -I/var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8/src -I/var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8_build -I/usr/include/jsoncpp -I/var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8/src/radiotray-ng/gui/editor/rtng-bookmark-editor -isystem /usr/lib64/wx/include/gtk3-unicode-3.2-gtk3 -isystem /usr/include/wx-3.2-gtk3  -O2 -pipe -march=native -Wall -Wextra -Werror -Wpedantic -pthread -std=gnu++14 -fdiagnostics-color=auto -MD -MT src/radiotray-ng/gui/editor/CMakeFiles/rtng-bookmark-editor.dir/station_drop_target.cpp.o -MF src/radiotray-ng/gui/editor/CMakeFiles/rtng-bookmark-editor.dir/station_drop_target.cpp.o.d -o src/radiotray-ng/gui/editor/CMakeFiles/rtng-bookmark-editor.dir/station_drop_target.cpp.o -c /var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8/src/radiotray-ng/gui/editor/station_drop_target.cpp
/var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8/src/radiotray-ng/gui/editor/station_drop_target.cpp: In member function ‘wxBitmap StationDragAndDrop::makeDragImage(const std::string&, const wxColour*, const wxColour*)’:
/var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8/src/radiotray-ng/gui/editor/station_drop_target.cpp:112:73: error: ‘wxFont::wxFont(int, int, int, int, bool, const wxString&, wxFontEncoding)’ is deprecated: use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants [-Werror=deprecated-declarations]
  112 |         tmp_dc.SetFont(wxFont(DRAG_FONT_POINT, wxSWISS, wxITALIC, wxBOLD));
      |                                                                         ^
In file included from /usr/include/wx-3.2-gtk3/wx/font.h:631,
                 from /usr/include/wx-3.2-gtk3/wx/window.h:23,
                 from /usr/include/wx-3.2-gtk3/wx/wx.h:38,
                 from /var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8/src/radiotray-ng/gui/editor/editor_app.hpp:21,
                 from /var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8/src/radiotray-ng/gui/editor/station_drop_target.cpp:29:
/usr/include/wx-3.2-gtk3/wx/gtk/font.h:89:5: note: declared here
   89 |     wxFont(int size,
      |     ^~~~~~
/var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8/src/radiotray-ng/gui/editor/station_drop_target.cpp:124:47: error: ‘wxPen::wxPen(const wxColour&, int, int)’ is deprecated: use wxPENSTYLE_XXX constants [-Werror=deprecated-declarations]
  124 |         dc.SetPen(wxPen(*textcolor, 1, wxSOLID));
      |                                               ^
In file included from /usr/include/wx-3.2-gtk3/wx/pen.h:107,
                 from /usr/include/wx-3.2-gtk3/wx/generic/statusbr.h:18,
                 from /usr/include/wx-3.2-gtk3/wx/statusbr.h:244,
                 from /usr/include/wx-3.2-gtk3/wx/frame.h:19,
                 from /usr/include/wx-3.2-gtk3/wx/wx.h:42:
/usr/include/wx-3.2-gtk3/wx/gtk/pen.h:51:5: note: declared here
   51 |     wxPen(const wxColour& col, int width, int style);
      |     ^~~~~
/var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8/src/radiotray-ng/gui/editor/station_drop_target.cpp:125:49: error: ‘wxBrush::wxBrush(const wxColour&, int)’ is deprecated: use wxBRUSHSTYLE_XXX constants [-Werror=deprecated-declarations]
  125 |         dc.SetBrush(wxBrush(*background, wxSOLID));
      |                                                 ^
In file included from /usr/include/wx-3.2-gtk3/wx/brush.h:77,
                 from /usr/include/wx-3.2-gtk3/wx/dc.h:24,
                 from /usr/include/wx-3.2-gtk3/wx/wx.h:51:
/usr/include/wx-3.2-gtk3/wx/gtk/brush.h:41:5: note: declared here
   41 |     wxBrush(const wxColour& col, int style);
      |     ^~~~~~~
/var/tmp/portage/media-radio/radiotray-ng-0.2.8/work/radiotray-ng-0.2.8/src/radiotray-ng/gui/editor/station_drop_target.cpp:134:69: error: ‘wxFont::wxFont(int, int, int, int, bool, const wxString&, wxFontEncoding)’ is deprecated: use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants [-Werror=deprecated-declarations]
  134 |         dc.SetFont(wxFont(DRAG_FONT_POINT, wxSWISS, wxITALIC, wxBOLD));
      |                                                                     ^
/usr/include/wx-3.2-gtk3/wx/gtk/font.h:89:5: note: declared here
   89 |     wxFont(int size,
      |     ^~~~~~
cc1plus: all warnings being treated as errors
ninja: build stopped: subcommand failed.
@Jambola77
Copy link

Yes, it would be great if a 0.2.9 could be official released.

@bugtracker2019
Copy link

Getting similiar warnings, but the compilation ends with success nevertheless.
Try to change your compiler setting (cc1plus: all warnings being treated as errors).

Arch Linux
wxwidgets-gtk3 3.2.5-1
wxwidgets-common 3.2.5-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants