User forums > General (but related to Code::Blocks)
TDM-GCC 4.6 series (Latest: 4.6.1 - 2011-09-23)
Justin Brimm:
Attempts to compile anything using the new version produces a multitude of errors, the first being:
--- Code: ---in: include/unknwn.h - error: unknown type name 'interface'
... etc
in: include/unknwn.h - error: unknown type name 'IUnknown'
in: include/unknwn.h - error: unknown type name 'IClassFactory'
--- End code ---
Edit: Traced the problem to objbase.h, line 19-23 and 43-4x
--- Code: ---#ifndef __OBJC__
#ifndef interface
#define interface struct
#endif
#endif
--- End code ---
The problem is that I use ObjC, which means interface never gets defined as a struct, which all the other windows headers require. I haven't had any problems in the past regarding the inclusion of windows headers, so this is a new one to me.
This is a horrible hack but it works and should at least get Objective-C working until a proper fix is found.
At the beginning of windows.h, add:
--- Code: ---// ObjC compatibility hack
#ifdef __OBJC__
#define __OBJC_WAS_DEF__ __OBJC__
#undef __OBJC__
#endif
--- End code ---
At the end of windows.h, add:
--- Code: ---// ObjC compatibility hack
#ifdef __OBJC_WAS_DEF__
#define __OBJC__ __OBJC_WAS_DEF__
#undef __OBJC_WAS_DEF__
#undef interface
#endif
--- End code ---
This code only works because I've never had to use the interface definition outside of windows.h, but if you're using Objective-C++, that may be a possibility.
thomas:
John, is there btw. a way you could not have the DW2 executables tagged -dw2?
I understand that this is meant so one can have several flavours of gcc in the same directory, but it does more evil than good. Having different flavours inside their own top-level directory works nicely to the same effect (and better, in my opinion).
Most build tools (this includes not only tools like automake and cmake, but also e.g. the windres supplied in the TDM install, which calls cpp and gcc) are too fucking stupid to figure out the compiler's proper name if it's anything except gcc. Some are less stupid than others, and some can be told to look for something else, but windres is even too stupid for that.
Which means that you can't build anything that uses windres, including wxWidgets, with the DW2 builds unless you manually make a copy of all files named -dw2.exe without the -dw2 tag first. Shortcuts don't work, for that matter.
This is the source of the totally clueless "windres: gcc exited with status 1" build failure that people encounter every now and then (and to which the error message is not truly helpful if you don't already know what the cause is).
Copying and renaming all the executables is an ordeal though, plus it takes up twice as much disk space than necessary.
ollydbg:
--- Quote from: thomas on September 28, 2011, 02:53:10 pm ---John, is there btw. a way you could not have the DW2 executables tagged -dw2?
--- End quote ---
I agree with thomas. I would also suggest there is a dw2 bundled package installer. :D
Justin Brimm:
Now that I can actually build my applications again using my (hopefully temporary hack), I want to send my thanks out to John. I've been eagerly awaiting GCC 4.6 ever since it was announced that the Objective-C runtime library was being completely rewritten from scratch to support Objective-C 2.0 and bring it inline with Apple's ObjC runtime. I hadn't made the switch though because I wanted to wait for the TDM-GCC 4.6 series; TDM-GCC is so much better and feature packed than other builds of gcc, that other builds aren't even a viable option anymore. 32/64 bit builds, full OpenMP support, ObjC support by standard (instead of as a separate package), etc.
Again, a hearty thanks for helping make Windows platform support comparable to MacOS X support.
thomas:
Bummer, LTO really isn't quite production just yet. :lol:
After patching lto-1.exe with a hex editor to be LARGEADDRESSAWARE, I just about managed to build wxWidgets (multimedia and RTTI disabled) with LTO enabled before running out of address space. Kids, don't try this at home if your machine only has 4GB of physical memory. Linking (just linking, not the entire build!) took only about 45 minutes, too. 8)
Unluckily it still gives me missing symbols from wxWidgets when building Code::Blocks (and, funnily, only 2 of them when building c::b without LTO, but around 25 with LTO enabled for c::b). Seems something is just not right yet. Ah well, maybe with gcc 4.7...
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version