Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

warning: inline function ... declared as dllimport

(1/1)

tiwag:
Whenever I compile C::B application using the default Project configuration file "CodeBlocks-wx2.6.0.cbp" from cvs ,
which sets compiler option -Wall,
I get thousands of warnings that look something like this:


--- Quote ---..wx260/include/wx/buffer.h:96: warning: inline function 'wxCharBuffer::wxCharBuffer(const char*)' is declared as dllimport: attribute ignored.
--- End quote ---


You can't have it both dllimport and inline.

This is fine, but I don't want this warning. I want the inlined version.

Is there a way to disable this warning? I didn't see anything that looked
useful in the GCC manual.

using
MinGW gcc 3.4.2, wxMSW 2.6.2, WinXP


[edit]
@all,
additionally i would like to know, if others get the same tons of warnings.
is this normal behaviour ?
otherwise i have to look if something is wrongly set up in my wxwidgets configuration.

thanks, tiwag

mandrav:
wxWidgets-2.6.0 generate a gazillion of warnings for me too...
I know I 'm not of much help, but I just thought I 'd share  :roll:

Yiannis.

tiwag:
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.



--- Code: ---
/* 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;
}
--- End code ---


regards,
tiwag

mandrav:

--- Quote ---which i can do, if mandrav is interested in.
--- End quote ---

Sure, just submit a patch :)

Yiannis.

heromyth:
Yeah, I have found that it won't produce the warning without the GCC compiler option '-W'. I have replace all '-W' in wxWidgets' makefile with none.

Navigation

[0] Message Index

Go to full version