News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

GCC 4.2.1 binary release for mingw is available from MINGW

Started by stahta01, August 08, 2007, 09:37:18 PM

Previous topic - Next topic

ingenuus

Quote from: RJP Computing on September 19, 2007, 03:17:01 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.

RJP Computing

Quote from: ingenuus on September 19, 2007, 06:18:11 AM
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 (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.
- Ryan

Ubuntu/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, ATI Radeon 9600XT 256MB

ingenuus

Quote from: RJP Computing on September 19, 2007, 02:03:32 PM
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.

Quote from: RJP Computing on September 19, 2007, 02:03:32 PM
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]

RJP Computing

Quote from: ingenuus on September 20, 2007, 03:18:22 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.

Quote from: ingenuus on September 20, 2007, 03:18:22 AM
...
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.

Quote from: ingenuus on September 20, 2007, 03:18:22 AM
btw, wxPack looks to be very useful.  Thanks! :)
Thanks.
- Ryan

Ubuntu/WinXP, AMD Athlon 64 3000+, 1000MB RAM, AC 97 Audio, ATI Radeon 9600XT 256MB

Blue-Tiger

Does anyone know how i can enable OpenMP-Support in the official MinGW release?

TDragon

Quote from: Blue-Tiger on September 25, 2007, 04:24:59 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.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Baluarte

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.




MortenMacFly

Quote from: Baluarte on October 05, 2007, 02:04:30 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Baluarte


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

Biplab

Quote from: Baluarte on October 05, 2007, 06:41:18 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.
Be a part of the solution, not a part of the problem.

MortenMacFly

Quote from: Biplab on October 05, 2007, 06:59:45 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]