i found a way to avoid the
warning: inline function 'wxcfoo::wxfoo()' is declared as dllimport: attribute ignored.[/list:u]
when compiling wxWidgets applications using the gcc_dll libraries,
and simultaneously using the compiler warnings i.e. "not to disable warnings in general"
one needs to use the following compiler setting:
Code::Blocks compiler settings:
check the following warnings
------------------------------------------------------------------------------
* Enable all compiler warnings (overrride every other setting) ..... results to (-Wall)
* Enable warnings demanded by strict ISO C ans ISO C++ ..... results to (-pedantic)
use the following under
more options:
------------------------------------------------------------------------------
-Wno-long-long
-Wcast-align
-Wconversion
-Wdeprecated
-Wimport
-Wnon-template-friend
-Wpmf-conversions
-Wpointer-arith
-Wsign-compare
-Wsynth
-Wwrite-strings[/list:u]
THis allows to compile standard wxWidgets samples like
minimal, console, listbox and widgets
( at least they i've tested ) without compile warnings.
When i try to build codeblocks with this compiler settings,
i found a few warnings and also compile errors,
which are trivial to avoid following the suggested actions from the warning- or error-messages.
When i do this corrections to the CB code i'm not longer in sync with the CVS version to incorporate latest diffs easy.
therefore i would like to know, if mandrav maybe is interested in using more effective compiler warning settings, in order to avoid hundreds of these nasty dll-import warnings with the effect, that some important and useful warnings are likely to be overseen in the vast number of warnings.
As i mentioned it would need some corrections to the code base,
things like
removing additional semicolons after some wxWidgets MACROS,
some class declarations are unnecessary here and there,[/list:u]
which i can do, if mandrav is interested in.
if one wants to experiment with it, here is the standard minimal sample,
which doesn't produce any warnings with my proposed compiler warning settings, when compiled to the gcc_dll wxwidget 2.4.2 and 2.6.0 libs.
/* wxminimal.cpp */
#include "wx/wx.h"
class HelloWorldApp : public wxApp
{
public:
virtual bool OnInit();
};
IMPLEMENT_APP(HelloWorldApp)
bool HelloWorldApp::OnInit()
{
wxFrame * frame = new wxFrame((wxFrame *) NULL, -1,
_T("Hello ")
_T(wxVERSION_STRING),
wxPoint(60,70),
wxSize(300,160));
frame->Show(TRUE);
SetTopWindow(frame);
return true;
}
regards,
tiwag