compiler warning from wx 3.1.1 font.h

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
new2wx
In need of some credit
In need of some credit
Posts: 7
Joined: Thu Feb 15, 2018 2:14 pm

compiler warning from wx 3.1.1 font.h

Post by new2wx »

I have minGW 6.3 and wxwidgets 3.1.1, and trying to use CB 17:12
CB helpfully created a sample 'hello world' project when I was trying to copy some sample code I found, but I have some problems..
1. The wizard didn't have an option for wx3.1 so I had to add some paths to the settings..
2. It included wx.h, which in turn includes window.h, and font.h - but I get a warning:

C:\GCC_Projects\WinGUI\HelloWorld\GUIDialog.cpp:35:73: warning: 'wxFont::wxFont(int, int, int, int, bool, const wxString&, wxFontEncoding)' is deprecated: use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants ie: wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD [-Wdeprecated-declarations]
m_staticText1->SetFont( wxFont( 20, 74, 90, 90, false, wxT("Arial") ) );
^
In file included from C:\wxWidgets311\include/wx/font.h:525:0,
from C:\wxWidgets311\include/wx/window.h:23,
from C:\wxWidgets311\include/wx/wx.h:38,
from C:\GCC_Projects\WinGUI\HelloWorld\GUIDialog.cpp:15:
C:\wxWidgets311\include/wx/msw/font.h:114:5: note: declared here

Then I get some linker errors I haven't yet found the fix for.. presumably another path setting required?

c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw31_core
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lwxbase31
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 16 second(s))

any help? I haven't started to write any of my own code, yet (and the only promising file in the samples/minimal folder seems to be 'minimal.cpp')
new2wx
In need of some credit
In need of some credit
Posts: 7
Joined: Thu Feb 15, 2018 2:14 pm

Re: compiler warning from wx 3.1.1 font.h

Post by new2wx »

I found the references to the linker files, and edited them to add the 'u' after the '31', and it has now built, and runs.. :)
Post Reply