Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: stahta01 on August 08, 2007, 09:37:18 pm

Title: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: stahta01 on August 08, 2007, 09:37:18 pm
https://sourceforge.net/project/showfiles.php?group_id=2435&package_id=241304

Direct link to notes
http://internap.dl.sourceforge.net/sourceforge/mingw/gcc-4.2.1-dw-release_notes.txt

Quote
GCC 4.2.1 binary release for mingw is available.

You can download it from:
https://sourceforge.net/project/showfiles.php?group_id=2435

The binaries are archived by language.

There are two versions, differing in the model used for exception unwind info.
  (1) Setjump-longjump (sjlj).  Historically,and currenetly, the default model.
  (2) Dwarf2 table-based unwinding (dw2).  The more efficient model.


*This is built with Dwarf 2 unwind info enabled. The gcc, g++ and
gfortran drivers in the bin directory have a '-dw2' suffix to indicate
that, You can remove '-dw2; from these files if you like.

If you want sjlj you will find them (soon) in the gcc-4.2.1-sjlj-1 package

The binaries were compiled with --enable-version-specific-runtime-libs.
The runtime libs are in <mingw-root>/lib/gcc/mingw32/gcc-4.2.1-dw2. Do
not move these files. If you really must, don't bother reporting
installation bugs.

Tim S

Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: dwmcqueen on August 08, 2007, 09:47:46 pm
You beat me to it.  I hope (and think) that TDragon's builds had some impact.  We had been batting those away on the MinGW list earlier....
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: killerbot on August 08, 2007, 09:54:52 pm
allright, this weekend I will try to build CB with it on windows. In case all seems fine, I might kick out a nightly with this. Could it be, at last, bye bye GCC 3.4.x ;-)
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: stahta01 on August 08, 2007, 10:26:05 pm
allright, this weekend I will try to build CB with it on windows. In case all seems fine, I might kick out a nightly with this. Could it be, at last, bye bye GCC 3.4.x ;-)

I am getting errors like below for wxWidgets and Code::Blocks, the error below is wxWidgets 2.9 trunk. Going to try another installation with different binutils.

Code
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccNY169T.s: Assembler messages:
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccNY169T.s:1448: Error: invalid character '_' in mnemonic
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccNY169T.s:1465: Warning: .def pseudo-op used inside of .def/.endef: ignored.
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccNY169T.s:1465: Error: junk at end of line, first unrecognized character is `_'
mingw32-make: *** [gcc_mswuddll\monodll_archive.o] Error 1

Error building wxWidgets reported by someone else on below link.

http://article.gmane.org/gmane.comp.gnu.mingw.user/23362

Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: roland on August 08, 2007, 10:27:43 pm
I was able to successfully build Allegro 4.2.2 and all of its components and demo programs with this version, but am unable to build it with TDM's latest build of 4.2.1.

Here is my post on the issue:  http://forums.codeblocks.org/index.php/topic,6512.msg50658.html#msg50658

So, all in all, a good sign, I think.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: TDragon on August 08, 2007, 11:35:08 pm
Awesome! Seems like it's about time for my builds to take the back seat again.

Edit:
If we get that bug fixed. Yup, it's there in 2.8.4 too.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: thomas on August 09, 2007, 09:28:58 am
allright, this weekend I will try to build CB with it on windows. In case all seems fine, I might kick out a nightly with this. Could it be, at last, bye bye GCC 3.4.x ;-)
Tried already, would have been too good if it worked. :(

First, the wxWidgets headers gernerate a thousand warnings (which is not so severe), and then it fails with
{standard input}:14784: Error: invalid character '_' in mnemonic
{standard input}:14801: Warning: .def pseudo-op used inside of .def/.endef: ignored.
{standard input}:14801: Error: junk at end of line, first unrecognized character is `_'

...whatever it means. No hint as to what source file the error refers to.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: patlecat on August 09, 2007, 09:44:57 am
Wow finally they did it. But TD can you tell us what took them so long? And when can we expect the next full MingW release?

And what about wxWidgets 2.9? Does anyone know how far this is? And what it will contain?
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: MortenMacFly on August 09, 2007, 01:23:11 pm
BTW: If you use the MinGW installer you will get mingw-runtime-3.13.tar.gz instead of mingw-runtime-3.12.tar.gz which is officially announced. Might be that this is related... or not... don't know as I'm ill and have to stay in bed. :(
With regards, Morten.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: Biplab on August 09, 2007, 01:43:40 pm
BTW: If you use the MinGW installer you will get mingw-runtime-3.13.tar.gz instead of mingw-runtime-3.12.tar.gz which is officially announced. Might be that this is related... or not... don't know as I'm ill and have to stay in bed. :(

mingw-runtime-3.13 and win32-api-3.10 has been released couple of days back. They are someway related to the latest gcc release.

Get well soon. :)
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: stahta01 on August 09, 2007, 02:34:20 pm
BTW: If you use the MinGW installer you will get mingw-runtime-3.13.tar.gz instead of mingw-runtime-3.12.tar.gz which is officially announced. Might be that this is related... or not... don't know as I'm ill and have to stay in bed. :(

mingw-runtime-3.13 and win32-api-3.10 has been released couple of days back. They are someway related to the latest gcc release.

Get well soon. :)

From http://internap.dl.sourceforge.net/sourceforge/mingw/gcc-4.2.1-dw-release_notes.txt

Quote
* libstdc++ and libgfortran require version 3.13 of mingw-runtime and
  w32api version 2.2 or higher.

* This package does _not_ contain binutils, the mingw-runtime
  or the w32api. You will need to get these if you do not already
  have mingw installed.

* libstdc++ and libgfortran require version 3.13 of mingw-runtime and
  w32api version 2.2 or higher.  Yes, I've said it twice now.

* Static and dll libraries of libgcc and libstdc++ are in the release.
  By default, linkage is to static libraries.  More details later.

* OpenMP is enabled.  To use it you will need to have  win32-pthreads package
  installed. More details later.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: wxLearner on August 09, 2007, 02:46:32 pm
Quote
* Static and dll libraries of libgcc and libstdc++ are in the release.
  By default, linkage is to static libraries.  More details later.
Has anybody found a shared version (dll) of libgcc?
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: stahta01 on August 09, 2007, 03:04:55 pm
Quote
* Static and dll libraries of libgcc and libstdc++ are in the release.
  By default, linkage is to static libraries.  More details later.
Has anybody found a shared version (dll) of libgcc?

No, I do have libstdc++ DLL and mingwm10.dll

Tim S
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: dwmcqueen on August 09, 2007, 03:49:58 pm
First, the wxWidgets headers gernerate a thousand warnings (which is not so severe), and then it fails with
{standard input}:14784: Error: invalid character '_' in mnemonic
{standard input}:14801: Warning: .def pseudo-op used inside of .def/.endef: ignored.
{standard input}:14801: Error: junk at end of line, first unrecognized character is `_'

...whatever it means. No hint as to what source file the error refers to.

According to the MinGW list - they are aware of the problem and will issue an update shortly.  Apparently they were too aggressive with some 4.3.0 backports.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: dwmcqueen on August 09, 2007, 03:51:06 pm
Wow finally they did it. But TD can you tell us what took them so long? And when can we expect the next full MingW release?

I can tell you - they were ready to issue the binaries, but not ready to support the release since they were still too busy on the prior release.  Someone stepped in and offered to help support the release - so they released it.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: wxLearner on August 09, 2007, 04:10:59 pm
Quote from: stahta01
No, I do have libstdc++ DLL
Me too. But it depends on a shared libgcc, which I do not find.

I have tried to throw an exception from a dll and catch it in an exe, but it does not work any longer with a statically linked runtime.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: TDragon on August 09, 2007, 04:56:07 pm
Wow finally they did it. But TD can you tell us what took them so long? And when can we expect the next full MingW release?
My answer to why it took so long would be to quote Greg Chicares from the MinGW lists:
Quote
If you wait to release until the software becomes stable, then it might be later than you'd like. If you opt to release earlier, then it might be less stable than you'd like. There are some people who choose a less-conservative tradeoff than the MinGW project; ...
and Keith Marshall:
Quote
We have one individual, (Danny), who is willing to manage GCC releases; he takes a cautious approach to that, for reasons which only he can definitively explain.
The next release? Probably shortly after GCC 4.3.0 is released (which will be labeled 4.4.0 if GCC goes ahead with their totally weird GPLv3 rebranding scheme).

I can tell you - they were ready to issue the binaries, but not ready to support the release since they were still too busy on the prior release.  Someone stepped in and offered to help support the release - so they released it.
I wasn't aware of anything like this; I wonder who it was?
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: snija on August 10, 2007, 05:20:07 am
Somebody can tell me why there`s no include in the root mingw directory and why they use a wired lib\gcc\mingw32\4.2.1-sjlj\include\c++ include directory?
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: stahta01 on August 10, 2007, 08:02:13 pm
Quote
no include in the root mingw directory
You forgot to do BinUtils and Runtime.

why they use a wired lib\gcc\mingw32\4.2.1-sjlj\include\c++ include directory?

Because that is the way MinGW does it; it is in order to do more than one version of GCC in a top level MInGW folder, but I don't try to do that. So, I have no idea how or if it works well.

Tim S

Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: snija on August 10, 2007, 08:30:58 pm
Thanks, I used to install binutils and w32api in separated folders and add their path into environment variables (C_INCLUDE_PATH & CPLUS_INCLUDE_PATH & LIBRARY_PATH).
If they use it in that way which means that you must unpacked it to c:\ otherwise .....
ignoring nonexistent directory "/mingw/lib/gcc/mingw32/4.2.1-dw2/include/c++"
ignoring nonexistent directory "/mingw/lib/gcc/mingw32/4.2.1-dw2/include/c++/min
gw32"
ignoring nonexistent directory "/mingw/lib/gcc/mingw32/4.2.1-dw2/include/c++/bac
kward"
ignoring nonexistent directory "/mingw/include"
I have to follow it and create a wired include directory "\include\c++\4.2.1-sjlj".
BTW, who actually find that libgcc_s_****.dll?
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: dwmcqueen on August 14, 2007, 01:53:56 pm
There has been a new release that supposedly fixed some of the bugs people were noticing from MinGW.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: killerbot on August 14, 2007, 02:30:29 pm
thanks for the info !!!

EDIT : trying to build wx284, with the dwarf (DW2) variant, in bin dir I removed the -dw2 from the gcc exes (not from the mingw32-*.exe)

EDIT2 : failed -> windres ...... on ../../src/msw/version.rc:12:24 error: wx/version.h : no such file or directory  :-(
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: thomas on August 14, 2007, 02:53:10 pm
mingw32-g++-dw2.exe -Ldevel -Lsrc\wxAUI -Lbase\tinyxml -LD:\wxMSW-2.8.4\lib\gcc_dll -LC:\gcc42\lib  -o devel\codeblocks.exe .objs\src\app.o .objs\src\appglobals.o .objs\src\associations.o .objs\src\compilersettingsdlg.o .objs\src\crashhandler.o .objs\src\dlgabout.o .objs\src\dlgaboutplugin.o .objs\src\environmentsettingsdlg.o .objs\src\infopane.o .objs\src\ipc.o .objs\src\main.o .objs\src\printdlg.o .objs\src\scriptconsole.o .objs\src\scriptingsettingsdlg.o .objs\src\splashscreen.o .objs\src\startherepage.o  .objs\src\resources\resources.res  --demangle  -lcodeblocks -lwxaui -lwxscintilla -lshfolder -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lcomctl32 -lodbc32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lwxmsw28u  -mwindows
.objs\src\app.o: In function `wxMemoryFSHandler':
Info: resolving SquirrelVM::_VM       by linking to __imp___ZN10SquirrelVM3_VME (auto-import)
D:/wxMSW-2.8.4/include/wx/fs_mem.h:60: undefined reference to `_imp___ZTV17wxMemoryFSHandler'
collect2: ld returned 1 exit status
Process terminated with status 1 (8 minutes, 37 seconds)
1 errors, 1996 warnings


Yay for MinGW! Compiling Code::Blocks works again :)


EDIT:  The linker error is no real error, since I've used the 3.4.5 libraries, this obviously cannot work. But most importantly, the compilation is just fine :)  Now off to rebuild wxWidgets...
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: thomas on August 14, 2007, 04:14:54 pm
(http://img339.imageshack.us/img339/9930/0000wv8.png)

There goes! :)
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: killerbot on August 14, 2007, 04:16:22 pm
did you use the dwarf or the other ? Since I got stuck at wx :-(

EDIT : it seems it has to do with windres.exe, I used the latest snapshot of binutils [remember the one where the fix is there for windres.exe for files/paths containing spaces], well it seems it has new problems now.
So I replaced the windres.exe with the one from the previous release of the binutils and I can get past my error point ...

Fix one, break one, so it seems ...

EDIT2 : I heard a MinGW developer visits our forum, I hope you see this ;-)
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: thomas on August 14, 2007, 04:58:08 pm
I used the Dwarf2 version with the whatever-version-binutils that I'm using with my 3.4.5.

First, I edited CC and CPP in build/msw/config.gcc as this should actually be the correct way. Of course it didn't work... lol... now thinking about it, I didn't honestly expect it to work either, that would have been the first painless wxWidgets build :P

But seriously, as this failed, I just renamed the -dw2.exe files, and it worked nicely. Compiling wxWidgets gives about 300,000 compiler warnings, as usual, but hey... compiling Code::Blocks gives about 2000 warnings (almost all of them from wxWidgets). But hey, it works great otherwise :)
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: killerbot on August 14, 2007, 05:03:31 pm
Quote
compiling Code::Blocks gives about 2000 warnings (almost all of them from wxWidgets)

f***, holy crap, I hope those wx guys will do something about their warnings some day.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: thomas on August 14, 2007, 05:34:30 pm
It's mostly about WXDLLEXPORT, WXDLLIMPEXP, WXDLLIMPEXP_SCI, and WXDLLIMPEXP_PG.

I have no idea what we need them for, anyway (or if at all?). Since we don't do any dynamic loading, I think those should be not needed at all? The linker should figure out a symbol if it's not exported, too... shouldn't it?

Anyway, that's what triggers the "attribute blah blah cannot blah" style error.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: dwmcqueen on August 14, 2007, 11:02:52 pm
So our the nightly builds going to move to 4.2.1 anytime soon ;)
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: insert_coin() on August 17, 2007, 08:47:42 am
Maybe it is not the correct place for this question, but does anyone know how to link mingwm10.dll statically?

Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: OLDSCHOOL on August 17, 2007, 12:50:06 pm
It's mostly about WXDLLEXPORT, WXDLLIMPEXP, WXDLLIMPEXP_SCI, and WXDLLIMPEXP_PG.

I have no idea what we need them for, anyway (or if at all?). Since we don't do any dynamic loading, I think those should be not needed at all? The linker should figure out a symbol if it's not exported, too... shouldn't it?

Anyway, that's what triggers the "attribute blah blah cannot blah" style error.


Hello, this is why mingw.org call 4.2.1  a Technology Preview.  There are  a stack of issues about c++ dll's   We can get them to work, no problem, now,  but, tomorrow ...  there are libstdc++ versioning  issues (has anybody read the MSDN article entitled something like ("Building DLL's is easy, maintaining them is the problem")  there is the question about how do we canonicalize gcc's  -Bstatic  vs -Bdynamic   diff into preprocessor defines that turn on/off dllimport/dllexport attributes (can we just use the MSVC++ precedent of -D_DLL  ...  well maybe, if we we are C/C++ centric and don't care about languages like Fortran/Ada that don't use a preprocessors), there are issues with .rdata and (yuck) --enable-auto-import  vs typeinfo data.

Hacks work today. Hubris is a nice feeling too, today.     I see all these smiley faces above me as I type.  I prefer  the spirit of the GPL that says download the source and submit a patch.  Or at least raise the question in a forum where a long-term solution is the focus.

Please help.

Wow, that was heavy.

In the event, when you hit an internal compiler error, please do read the instructions and submit a **useful** bug report .

No fault.
Perseverance Furthers.

Here is a picture of my long-ago  friends from another time thinking about Further ...

http://www.lib.virginia.edu/cgi-bin/imgload.cgi/53


OS
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: pir on August 30, 2007, 11:22:28 am
Having a problem getting version 4.2.1 working! (Strictly a mingw/gcc problem, not a CodeBlocks problem but...)
 
When I try to invoke the compiler (from the command line or from C::B), I get a message:
 
"mingw32-g++.exe: CreateProcess: No such file or directory"
 
Here I've renamed the .exe by removing the "-dw2" bits but it makes no difference leaving the "-dw2" naming as is - same error. Flipping the toolchain back to 3.4.5, the thing runs fine with no changes.
 
Since you guys seem to have got it working OK, any suggestions welcome.

BTW: WinXP-SP2
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: stahta01 on August 30, 2007, 01:59:59 pm
Having a problem getting version 4.2.1 working! (Strictly a mingw/gcc problem, not a CodeBlocks problem but...)
 
When I try to invoke the compiler (from the command line or from C::B), I get a message:
 
"mingw32-g++.exe: CreateProcess: No such file or directory"
 
Here I've renamed the .exe by removing the "-dw2" bits but it makes no difference leaving the "-dw2" naming as is - same error. Flipping the toolchain back to 3.4.5, the thing runs fine with no changes.
 
Since you guys seem to have got it working OK, any suggestions welcome.

BTW: WinXP-SP2

Try changing the file name in C::B compiler settings

Under tab "Toolchain Executables" I have
C Compiler:  mingw32-gcc.exe
C++ Compiler: mingw32-g++.exe
Linker for Dyn Libs: mingw32-g++.exe

Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: pir on August 30, 2007, 04:10:06 pm
Quote
Try changing the file name in C::B compiler settings

Under tab "Toolchain Executables" I have
C Compiler:  mingw32-gcc.exe
C++ Compiler: mingw32-g++.exe
Linker for Dyn Libs: mingw32-g++.exe

Thanks, but I have tried that already. The problem still occurs running the compiler from the command line so it's not really a C::B problem.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: thomas on August 30, 2007, 06:01:06 pm
Do you have the C++ compiler installed at all? This sounds like a stupid question, but it can actually happen.

gcc (or mingw-gcc) is no compiler, you know. It is only a frontend to about half a dozen different compilers that all work via one common interface, and g++ being one of these compilers.
If gcc complains that there is no such file as mingw32-g++.exe, this suggests that you have downloaded the base package, but not the C++ package (or, it could be that paths are set up badly).
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: pir on August 30, 2007, 06:28:08 pm
Do you have the C++ compiler installed at all? This sounds like a stupid question, but it can actually happen.

gcc (or mingw-gcc) is no compiler, you know. It is only a frontend to about half a dozen different compilers that all work via one common interface, and g++ being one of these compilers.
If gcc complains that there is no such file as mingw32-g++.exe, this suggests that you have downloaded the base package, but not the C++ package (or, it could be that paths are set up badly).

I installed gcc-core and the g++ frontend together with the runtime and win32api stuff. Am I forgetting something? The path contains c:\mingw\bin. The compiler seems to be starting but but bails with an internal error. Basically, I have installed 3.4.5 in exactly the same way and that works fine. I can't see what I'm doing differently.

BTW: 'Stupid' questions are often very good questions!
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: thomas on August 30, 2007, 06:59:15 pm
Hmm... I have done the exact same (even the install path and the OS are incidentally the same).

Everything just works, did not have to configure a single thing... this makes it kind of hard  :(
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: pir on August 31, 2007, 06:49:04 pm
Right then!

I have installed version 4.2.1 on another machine and it (nominally!) works - more on this below. Therefore I conclude that part of the OS on the first machine I tried and which gave the CreateProcess problem has got mangled. In fact, I have seen this before with XP - strange, illogical things start creeping in. I will repair over the weekend and see if that makes a difference. Other than that, a fresh install. (Oh joy!)

I say 4.2.1 nominally works. I can build the "Hello world!" program from the command line, no problem. But when I try to build it from C::B, I get loads of weird linker errors: undefined references to __gxx_personality_v0, _Unwind_SjLj_Register, _Unwind_SjLj_Unregister, etc. The last ones puzzle me big time! I have absolutely definitely installed both the core and g++ dw2 variants. (Very sure. Double-checked, repeated install.) But the linker seems to be looking for bits from the other sjlj variant of version 4.2.1? Or might it be from 3.4.5 which co-exists on the machine but obviously in a different directory. Very sure I have the toolchain exe location/filenames correct. Nonetheless the program builds successfully from the command line!

Doh!
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: RJP Computing on August 31, 2007, 07:51:53 pm
I have built wxWidgets with MinGW Gcc_v4.2.1-dw2 and created a custom "unofficial" installer for MinGW Gcc 4.2.1-dw2. Please see if these help you get it working. I have had really good luck using this method. That is why I shared.

http://wxpack.sf.net/Main/Downloads
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: pir on September 03, 2007, 11:05:35 am
Interesting. But building wxWidgets invokes the compiler from the command line via make. Have you managed to build anything by spawning 4.2.1 from within CodeBlocks? Like "Hello world", for example? It would be helpful to know if someone else can do this without problems.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: RJP Computing on September 03, 2007, 07:57:53 pm
Interesting. But building wxWidgets invokes the compiler from the command line via make. Have you managed to build anything by spawning 4.2.1 from within CodeBlocks? Like "Hello world", for example? It would be helpful to know if someone else can do this without problems.
Of coarse. I build all my projects with MinGW 4.2.1. It works fine in Code::Blocks and make.


NOTE: These instructions are assuming you are using the simple installer for MinGW v4.2.1 from http://wxpack.sf.net/Main/Downloads

You need to make sure if you installed MinGW to a different directory, other than 'C:\MinGW', that you change four directory paths in Code::Blocks. You need to change the 'Settings->Compiler and Debugger...->Toolchain Executables->Compiler's installation directory' to your custom path (e.g C:\MinGW4). I also must mention that you should NOT install MinGW in a path with spaces. At least until I hear differently. This is the official release and I don't believe it will handle this well, so don't do it. Then you need to change the three directories under 'Settings->Compiler and Debugger...->Search Directories->Compiler', 'Settings->Compiler and Debugger...->Search Directories->Linker', and 'Settings->Compiler and Debugger...->Search Directories->Resource Compiler' to match your installation of MinGW (e.g. 'C:\MinGW4\include).

That is all you should need to do. Hope this helps.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: Conan Kudo on September 03, 2007, 08:50:11 pm
I have built C::B and wxWidgets 2.8.4 built using GCC 4.2.1-sjlj. The dw2 version doesnt seem to work as well as the sjlj version. However, I have noticed that not all the plugins are set to build when I tell the workspace to build, and the envvars plugin cannot handle long file names when linking the DLL...
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: pir on September 07, 2007, 10:51:07 am
Quote
Then you need to change the three directories under 'Settings->Compiler and Debugger...->Search Directories->Compiler', 'Settings->Compiler and Debugger...->Search Directories->Linker', and 'Settings->Compiler and Debugger...->Search Directories->Resource Compiler' to match your installation of MinGW (e.g. 'C:\MinGW4\include).

Ho-hum! Missed that bit... I was only setting the toolchain directories, which may explain why I was getting link errors (although still puzzled that the supposedly distinct "dw2" variant was looking for "sjlj" things?)

Thanks - works fine now. I'll just place my tail between my legs and skulk off into a corner...
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: ingenuus on September 18, 2007, 10:37:26 pm
The libgcc dll (sjlj or dw2) is a separate download.  See the MinGW GCC Version 4 package download page on SourceForge:

http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=241304

Also, does anyone know if the dw2 version is safe on win32?  Everyone seems to be using it but I thought that dw2 couldn't unwind foreign frames and so couldn't handle exceptions in the OS or callbacks.  Are they just betting that exceptions won't occur or has something changed?
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: RJP Computing on September 19, 2007, 03:17:01 am
...
Also, does anyone know if the dw2 version is safe on win32?  Everyone seems to be using it but I thought that dw2 couldn't unwind foreign frames and so couldn't handle exceptions in the OS or callbacks.  Are they just betting that exceptions won't occur or has something changed?

It is working great for me. Actually it fixes a bug in the 3.4.5 sjlj model. It now can properly catch an exception passing the Compiled as C throwing to my C++ main program barrier (I don't know if there is a technical term for that :) ). The exceptions seem to be working as good as Visual C++. I have compiled and use wxWidgets 2.8.4 with it as well.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: ingenuus on September 19, 2007, 06:18:11 am
It is working great for me. Actually it fixes a bug in the 3.4.5 sjlj model. It now can properly catch an exception passing the Compiled as C throwing to my C++ main program barrier (I don't know if there is a technical term for that :) ). The exceptions seem to be working as good as Visual C++. I have compiled and use wxWidgets 2.8.4 with it as well.

Thanks for the good report!  Are you referring to throwing an exception from within (or below) WndProc and catching it in WinMain?  My understanding is that since WndProc is a callback, there are OS frames between WndProc and WinMain which dw2 cannot unwind, but perhaps this has been fixed.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: RJP Computing on September 19, 2007, 02:03:32 pm
Thanks for the good report!  Are you referring to throwing an exception from within (or below) WndProc and catching it in WinMain?  My understanding is that since WndProc is a callback, there are OS frames between WndProc and WinMain which dw2 cannot unwind, but perhaps this has been fixed.
Is there a specific test I can run to help you out? I have released a simple installer that can live side by side with MinGW v3.x.x. You can easily uninstall it after you are done. It doesn't set any environment variables or things like that. If you would like you can find it here (http://wxpack.sf.net/Main/Downloads) (MinGW Gcc v4.2.1 Unofficial Installer at the bottom of the downloads page).

Well I am referring to C++ and Lua. In Lua when you have an error, the error needs to propagate from _longjmp/_setjmp. This completely did not work in 3.4.5. I don't know the technical terms for crossing the 'C' code to 'C++' code barrier, but that is what seemed to be fixed.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: ingenuus on September 20, 2007, 03:18:22 am
Is there a specific test I can run to help you out?

That's very kind of you to offer, but after constructing a simple test, it wasn't too difficult to build it myself.  I attached the source to this post in case you're curious.

Left click in the client area to throw an exception from WndProc that should be caught in WinMain.  Right click just tests that exceptions work.

Unfortunately, based upon that test, dw2 does not function properly: an exception cannot propagate through foreign (OS) frames -- instead it terminates.  It appears to work fine with 4.2.1-sjlj.

But as long as one is careful to catch exceptions within callbacks (before any non-dw2 frames), I guess any problems can be avoided.

Well I am referring to C++ and Lua. In Lua when you have an error, the error needs to propagate from _longjmp/_setjmp. This completely did not work in 3.4.5. I don't know the technical terms for crossing the 'C' code to 'C++' code barrier, but that is what seemed to be fixed.

That's interesting.  I imagine that would also be fixed in 4.2.1-sjlj.  Did you build both your app and Lua with gcc-4.2.1-dw2?

btw, wxPack looks to be very useful.  Thanks! :)

Kevin

[attachment deleted by admin]
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: RJP Computing on September 20, 2007, 04:59:03 am
That's very kind of you to offer, but after constructing a simple test, it wasn't too difficult to build it myself.  I attached the source to this post in case you're curious.

Left click in the client area to throw an exception from WndProc that should be caught in WinMain.  Right click just tests that exceptions work.

Unfortunately, based upon that test, dw2 does not function properly: an exception cannot propagate through foreign (OS) frames -- instead it terminates.  It appears to work fine with 4.2.1-sjlj.
I will try. I really hope this is fixed.

...
That's interesting.  I imagine that would also be fixed in 4.2.1-sjlj.  Did you build both your app and Lua with gcc-4.2.1-dw2?
Yes I build both with the same compiler.

btw, wxPack looks to be very useful.  Thanks! :)
Thanks.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: Blue-Tiger on September 25, 2007, 04:24:59 pm
Does anyone know how i can enable OpenMP-Support in the official MinGW release?
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: TDragon on September 25, 2007, 05:41:16 pm
Does anyone know how i can enable OpenMP-Support in the official MinGW release?
First, you need to build pthreads-win32 (the standard DLL -- "make GC-inlined"); second, you need to add "-fopenmp" and the path to the DLL (typically "pthreadGC2.dll") to your command line.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: Baluarte on October 05, 2007, 02:04:30 pm
Hi!

Perhaps this object of discussion is not in the correct place, but I am without ideas.

I am working with last nightly build of Codeblocks. Until now, my compilers have been  gcc 3.4.5 (official MinGW), gcc 4.2.0 (TDragon) and gcc 4.2.1 (TDragon). No problem!

However, When I try the official new version (MinGW with gcc 4.2.1-dw2-2) (Installed manually or installed with the MinGW Gcc v4.2.1 Unofficial Installer help [by RJP Computing]) i get strange link errors. (???)

Maybe a lost flag or... I have not a a remote idea!

For example!

The code:

// my first program in C++

#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!";
  return 0;
}

I get:

[100.0%] g++.exe -LC:\mSYS\local\lib -LC:\mSYS\local\lib\boost-1.34.1\lib -LC:\MinGW\lib\gcc\mingw32\4.2.1-dw2 -LC:\MinGW\lib  -o bin\Release\DisplayOPENGL.exe obj\Release\Main.o   -s -L/usr/local/lib  -mthreads  -Wl,--subsystem,windows -mwindows -lwx_msw_aui-2.8 -lwx_msw_xrc-2.8 -lwx_msw_qa-2.8 -lwx_msw_html-2.8 -lwx_msw_adv-2.8 -lwx_msw_core-2.8 -lwx_base_xml-2.8 -lwx_base_net-2.8 -lwx_base-2.8  -lwx_msw_richtext-2.8 -lMagick++ -lWand -lMagick -lgdi32 -lm -lpthreadGC2 -lSDL 
obj\Release\Main.o: In function `_static_initialization_and_destruction_0':
c:/mingw/bin/../lib/gcc/mingw32/4.2.1-dw2/include/c++/iostream:77: undefined reference to `_imp___ZNSt8ios_base4InitC1Ev'
obj\Release\Main.o: In function `_tcf_0':
c:/mingw/bin/../lib/gcc/mingw32/4.2.1-dw2/include/c++/iostream:77: undefined reference to `_imp___ZNSt8ios_base4InitD1Ev'
obj\Release\Main.o: In function `operator<< <std::char_traits<char> >':
c:/mingw/bin/../lib/gcc/mingw32/4.2.1-dw2/include/c++/ostream:517: undefined reference to `_imp___ZSt4cout'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
3 errors, 0 warnings

I am desolated! Any comment? Thank you!

Baluarte

PD:Sigh! Sorry for my poor and schematic english! My native language is spanish.

 

Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: MortenMacFly on October 05, 2007, 02:32:12 pm
[100.0%] g++.exe -LC:\mSYS\local\lib -LC:\mSYS\local\lib\boost-1.34.1\lib -LC:\MinGW\lib\gcc\mingw32\4.2.1-dw2 -LC:\MinGW\lib  -o bin\Release\DisplayOPENGL.exe obj\Release\Main.o   -s -L/usr/local/lib  -mthreads  -Wl,--subsystem,windows -mwindows -lwx_msw_aui-2.8 -lwx_msw_xrc-2.8 -lwx_msw_qa-2.8 -lwx_msw_html-2.8 -lwx_msw_adv-2.8 -lwx_msw_core-2.8 -lwx_base_xml-2.8 -lwx_base_net-2.8 -lwx_base-2.8  -lwx_msw_richtext-2.8 -lMagick++ -lWand -lMagick -lgdi32 -lm -lpthreadGC2 -lSDL 
For your example why do you link against:
- a million wx libs
- Magick++
- math library
- pthread
- SDL
???
Please create a plain console app, don't link against any additional lib and see if it's still the same...
With regards, Morten.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: Baluarte on October 05, 2007, 06:41:18 pm

8-O

Ah! I am shocked!! I never thought a Codeblocks Developer answered to me! TO ME! I am not a believer person but God(dess) (s) bless your generous mind and skilled hands!
Very grateful for your unforeseen interest!

I am convinced that your proyect "CODEBLOCKS" remarkably encourages the C++ development.

In any sense this piece of software is so important like free compilers because it is a democratising tool in multiple planes. Machines/Platforms. Operating Systems. Compilers. Users according to  purchasing power. Users according to knowledge. Users according to use easiness and so on.
 
 (C++ Eclipse Plugin CDT.Anjunta, DevCPP, KDevelop, Builder IDE, Visual Studio IDE, XCode) had/have not such power.
 
On the other hand, beyond any trascendental dream, the design is very cute. Complete. Generic. Understandable. Natural... The Oxford dictionary have not enough positive adjetives!

At the end, Open-Source and free. Thanks!


My trouble:

I didnĀ“t consider the flags because the same flags had worked with other compiler versions. In fact previously I had built all dependent libraries with gcc 4.2.1-dw2 without troubles.
I admit I was blinded. I am shamed. Sorry!

But I wake! I followed your  reductionist approximation and I found the source of the problem.

Simply, under the tab "#defines" in Compiler and debugger I had:

WXUSINGDLL
__WXMSW__
WXUSINGDLL=1
NO_GCC_PRAGMA
_DLL
_MT


Why is that here? I can not remember it. But I do not worry! I do not need it!

I apologize you for my abominable english
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: Biplab on October 05, 2007, 06:59:45 pm
Why is that here? I can not remember it. But I do not worry! I do not need it!

I guess you tried to use a wxWidgets project to compile your console app.
Title: Re: GCC 4.2.1 binary release for mingw is available from MINGW
Post by: MortenMacFly on October 05, 2007, 07:33:09 pm
I guess you tried to use a wxWidgets project to compile your console app.
Possibly - yes. But this would still make me wonder where all those references to SDL, pthread and "whatever" libs are comping from. Strange enough.