User forums > General (but related to Code::Blocks)

Compiling precompiled headers file with Code::Blocks

(1/5) > >>

yakumoklesk:
I am trying to compile the precompiled header file wx_pch.h. The following are its contents:


--- Code: ---#ifndef __WX_PCH_H_INCLUDED__
#define __WX_PCH_H_INCLUDED__

#if ( defined(USE_PCH) && !defined(WX_PRECOMP) )
    #define WX_PRECOMP
#endif // USE_PCH

// basic wxWidgets headers
#include <wx/wxprec.h>

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif

#ifdef USE_PCH
// put here all your rarely-changing header files
#endif // USE_PCH

#endif // __WX_PCH_H_INCLUDED__

--- End code ---

But I get alot of warnings of this kind:


--- Code: ---In file included from C:\prog32\sdk\wxWidgets-2.8.4\include/wx/gdicmn.h:20,
                 from C:\prog32\sdk\wxWidgets-2.8.4\include/wx/msw/private.h:213,
                 from C:\prog32\sdk\wxWidgets-2.8.4\include/wx/msw/wrapcdlg.h:18,
                 from C:\prog32\sdk\wxWidgets-2.8.4\include/wx/wxprec.h:47,
                 from src/wx_pch.h:9,
                 from <command-line>:0:
C:\prog32\sdk\wxWidgets-2.8.4\include/wx/list.h:506: warning: type attributes ignored after type is already defined

--- End code ---

and others of this kind:


--- Code: ---In file included from C:\prog32\sdk\wxWidgets-2.8.4\include/wx/wx.h:19,
                 from C:\prog32\sdk\wxWidgets-2.8.4\include/wx/wxprec.h:68,
                 from src/wx_pch.h:9,
                 from <command-line>:0:
C:\prog32\sdk\wxWidgets-2.8.4\include/wx/hash.h:117: warning: attributes ignored on elaborated-type-specifier that is not a forward declaration

--- End code ---

I am using mingw32 gcc-4.2.1-sjlj compiler.
wxWidgets have been build with the same compiler, in release mode, in unicode, with opengl, xrc

Does anybody knows if this is normal? I am committing a mistake? Is there any way of getting rid of those warnings?

Thanks in advance.

stahta01:

--- Quote ---warning: attributes ignored on elaborated-type-specifier that is not a forward declaration

--- End quote ---

That warning is normal in 4.2 GCC.

Tim S

yakumoklesk:
But is there a kind of pragma or something to avoid them? I really hate having warning during the build of my code. I am a little fussy and like to see: "0 errors, 0 warnings."

TDragon:
Adding "-Wno-attributes" to the compiler options will get rid of most of the warnings. "-w" will suppress all warnings of any kind.

yakumoklesk:
Well, is not that I want to suppress the warnings when they really exist, because some warnings can hide potential runtime errors. But get ridding *only* of those specific warnings that are supposed to be harmless and common would be nice. Does "-Wno-attributes" affects to those to warnings only?

Navigation

[0] Message Index

[#] Next page

Go to full version