jdla | 1 Jan 2010 12:45
Picon

Avoiding 'pop up' windows at crash.


Dear group,

I have a small issue on which I did not find the answer. Probably it's a 
bit of a weird one too.

In the process of configuring (autoconfigure tools) a program of mine 
under mingw32, I need to do a number of tests by creating, compiling and 
running a small test.
It is normal behaviour that that test program *can* crash. It's the 
intent indeed to check if that feature does work or not. If it doesn't 
work, there's a crash. (*)
However, when crashing, there's a 'popup' window (created by 'windows') 
to notify about this crash and give the option to report to MS.
Also the user has to click 'OK' then.
Is there any technique or possibility you are aware of to have a mingw 
compiled program tested (and potentially crashed) completely in the MSYS 
shell without such 'popups' ?
Be aware, it is not the 'console option' issue. 'console' is on and 
doing it's work also. It's just that it escapes in above described way 
from being console only program.

Thanks in advance,

Jos

(*) for the curious ones : it tests whether pthreads and OpenMP 
cooperate , which is *not* the case up to the latest mingw gcc 
compilers. (but it is ok for gcc 4.X under Linux).

(Continue reading)

JC | 1 Jan 2010 14:44
Picon
Favicon

Re : undefined reference with ___mingw_vfprintf

Here is the link command line generated by my IDE (CodeBlocks) followed by the result of the command line. I wish it can help, I don't see anything strange for me.

-------------- Build: Debug in jkt2010_CodeBlocks ---------------
mingw32-g++.exe -LLibs\SDL-1.2.14-MinGW\lib -LLibs\agar-1.3.4-recompile\lib -LLibs\freetype-2.3.5-1-bin\lib -LLibs\fmodapi375win\api\lib -LLibs\Pre-built.2\lib -LLibs\SDL_image-1.2.10\lib -LLibs\SDL_net-1.2.7\lib  -o bin\Debug\jkt2010.exe obj\Debug\Libs\tinyxml_2_5_2\tinystr.o obj\Debug\Libs\tinyxml_2_5_2\tinyxml.o obj\Debug\Libs\tinyxml_2_5_2\tinyxmlerror.o obj\Debug\Libs\tinyxml_2_5_2\tinyxmlparser.o obj\Debug\Menu\Dlg.o obj\Debug\Menu\DlgBoite.o obj\Debug\Menu\MAide.o obj\Debug\Menu\MAudio.o obj\Debug\Menu\MAudioDrivers.o obj\Debug\Menu\MAudioDriversDriver.o obj\Debug\Menu\MAudioOutput.o obj\Debug\Menu\MAudioRecord.o obj\Debug\Menu\MCommandes.o obj\Debug\Menu\MConfiguration.o obj\Debug\Menu\MDebug.o obj\Debug\Menu\MDisplay.o obj\Debug\Menu\MDisplaySize.o obj\Debug\Menu\MMenuPrinc.o obj\Debug\Menu\MMenuPrinc2.o obj\Debug\Menu\MMode.o obj\Debug\Menu\MMultijoueur.o obj\Debug\Menu\MMultijoueurClientInfo.o obj\Debug\Menu\MMultijoueurClientPing.o obj\Debug\Menu\MMultijoueurServeur.o obj\Debug\Menu\MMultijoueurServeurLancePartie.o obj\Debug\Menu\MOpenASE.o obj\Debug\Menu\MOpenMAP.o obj\Debug\Menu\MOpenScene.o obj\Debug\Menu\MReseau.o obj\Debug\Menu\Menu.o obj\Debug\Menu\Portail.o obj\Debug\src\DeleteWithGame.o obj\Debug\src\centralisateur\Centralisateur.o obj\Debug\src\centralisateur\CentralisateurState.o obj\Debug\src\centralisateur\UdpConnector.o obj\Debug\src\centralisateur\UdpController.o obj\Debug\src\centralisateur\data\Data.o obj\Debug\src\centralisateur\data\ListData.o obj\Debug\src\centralisateur\data\SignalementData.o obj\Debug\src\exception\JktException.o obj\Debug\src\exception\centralisateur\BindingUdpException.o obj\Debug\src\exception\centralisateur\CentralisateurException.o obj\Debug\src\exception\centralisateur\OpenUdpSocketException.o obj\Debug\src\ifstreamWork.o obj\Debug\src\main\Cfg.o obj\Debug\src\main\Clavier.o obj\Debug\src\main\Fabrique.o obj\Debug\src\main\Focus.o obj\Debug\src\main\Game.o obj\Debug\src\main\JKT.o obj\Debug\src\main\Laser.o obj\Debug\src\main\Photo.o obj\Debug\src\main\Player.o obj\Debug\src\main\Projectil.o obj\Debug\src\main\RequeteProcess.o obj\Debug\src\main\Rocket.o obj\Debug\src\main\divers.o obj\Debug\src\main\glfont2.o obj\Debug\src\menu\Controller.o obj\Debug\src\menu\MainMenuView.o obj\Debug\src\menu\OpenCentralisateurView.o obj\Debug\src\menu\OpenSceneASEView.o obj\Debug\src\menu\OpenSceneMapView.o obj\Debug\src\menu\OpenSceneView.o obj\Debug\src\menu\View.o obj\Debug\src\menu\Viewer.o obj\Debug\src\reseau\Client.o obj\Debug\src\reseau\Reseau.o obj\Debug\src\reseau\SPA.o obj\Debug\src\reseau\Server.o obj\Debug\src\reseau\a_virer.o obj\Debug\src\ressource\RessourcesLoader.o obj\Debug\src\son\DemonSons.o obj\Debug\src\son\ReqSon.o obj\Debug\src\son\Son.o obj\Debug\src\son\audio.o obj\Debug\src\spatial\FichierASE.o obj\Debug\src\spatial\IfstreamMap.o obj\Debug\src\spatial\Map.o obj\Debug\src\spatial\MoteurParticules.o obj\Debug\src\spatial\Mouve.o obj\Debug\src\spatial\Particule.o obj\Debug\src\spatial\XmlVocabulaire.o obj\Debug\src\spatial\contact.o obj\Debug\src\spatial\geo\ChanTex.o obj\Debug\src\spatial\geo\Geo.o obj\Debug\src\spatial\geo\GeoMaker.o obj\Debug\src\spatial\geo\GeoObject.o obj\Debug\src\spatial\geo\MultiMaterialGeo.o obj\Debug\src\spatial\geo\SimpleGeo.o obj\Debug\src\spatial\geo\SimpleMaterialGeo.o obj\Debug\src\spatial\geo\TexVertexList.o obj\Debug\src\spatial\geo\TextureMaterialGeo.o obj\Debug\src\spatial\light\Light.o obj\Debug\src\spatial\light\LightMaker.o obj\Debug\src\spatial\light\LightOmni.o obj\Debug\src\spatial\light\LightTarget.o obj\Debug\src\spatial\materiau\Material.o obj\Debug\src\spatial\materiau\MaterialMaker.o obj\Debug\src\spatial\materiau\MaterialMulti.o obj\Debug\src\spatial\materiau\MaterialTexture.o obj\Debug\src\spatial\materiau\Textures.o obj\Debug\src\spatial\objet\Navette.o obj\Debug\src\spatial\objet\Porte.o obj\Debug\src\util\Erreur.o obj\Debug\src\util\FindFolder.o obj\Debug\src\util\GenRef.o obj\Debug\src\util\Tableau.o obj\Debug\src\util\TableauIndex.o obj\Debug\src\util\Trace.o obj\Debug\src\util\TraceMethod.o obj\Debug\src\util\V3D.o obj\Debug\src\util\XmlHelper.o obj\Debug\src\util\mathFast.o obj\Debug\src\util\math_vectoriel.o obj\Debug\src\util\utils_SDL.o    -lmingw32 -lag_gui_static -lag_core_static -lwinmm -lfreetype -lSDLmain -lSDL -lSDL.dll -lopengl32 -lglu32 -lSDL_net -lSDL_image -lfmodvc -lpthreadGC2 -lmingwex
 
Libs\agar-1.3.4-recompile\lib/libag_gui_static.a(file_dlg.o): In function `fprintf':
C:/MinGW/include/stdio.h:246: undefined reference to `___mingw_vfprintf
'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 14 seconds)
1 errors, 0 warnings

De : Keith Marshall <keithmarshall-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
À : mingw-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Envoyé le : Jeu 31 Décembre 2009, 19 h 29 min 38 s
Objet : Re: [Mingw-users] undefined reference with ___mingw_vfprintf

On Thursday 31 December 2009 17:30:59 JonY wrote:
> I thought he was using msvc "cl" to compile and link, which needs
> to be told to use libmingwex.a.

It would, IF the dependency on MinGW's enhanced printf() subsystem is
REALLY desired.  When building a library intended for use with other
compilers than MinGW, it may be a rash choice to introduce that
dependency; better IMO, to understand why the dependency arises in
the first place, and then make an informed choice on whether to keep
it, or to eliminate it.

> Apparently, this is not the case.

No.  The clue was in the error message originally posted:

> ... In function `fprintf':
> C:/MinGW/include/stdio.h:246: undefined reference to
> `___mingw_vfprintf'
> collect2: ld returned 1 exit status

The use of collect2 suggests a GNU tool chain, (and the reference in
question shows us that some compilation unit in the project was
built with compile time flags to explicitly map fprintf() to
__mingw_fprintf(), rather than to the default __msvcrt_fprintf()).

--

Regards,
Keith.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
MinGW-users mailing list
MinGW-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Keith Marshall | 1 Jan 2010 16:35
Picon

Re: Re : undefined reference with ___mingw_vfprintf

On Friday 01 January 2010 13:44:13 JC wrote:
> Here is the link command line generated by my IDE (CodeBlocks)
> followed by the result of the command line. I wish it can help, I
> don't see anything strange for me.
>
> [...snip...]

No, I don't see anything obvious either; the `-lmingwex' at the end 
should not be necessary, but it can't hurt.

To diagnose this further, we need to go back to basics.  Please try 
the following simple test case:--

  $ cat testcase.c
  #include <stdio.h>

  int main()
  {
    long double a = 10.0, b = 50.0;
    printf( "a = %Lf; b = %Lf; a * b = %Lf\n", a, b, a * b );
    return 0;
  }

First compile and run it, using only default compiler options; you 
should see something like this:

  $ mingw32-gcc -o testcase.exe testcase.c

  $ ./testcase.exe
  a = -0.000000; b = 0.000000; a * b = 0.000000

Clearly, not what you'd expect from the code, but here we are using 
Microsoft's printf() implementation, which is unable to interpret 
MinGW's 80-bit `long double' data type, so it is the appropriate
outcome.  Now, compile and run it again, but this time compile with 
the `-posix' option, (which is one way to activate MinGW's enhanced 
printf() subsystem); this time you should see:

  $ mingw32-gcc -posix -o testcase.exe testcase.c

  $ ./testcase.exe
  a = 10.000000; b = 50.000000; a * b = 500.000000

Let us know how you get on.

-- 

Regards,
Keith.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

Tor Lillqvist | 1 Jan 2010 18:44
Picon
Picon
Favicon

Re: undefined reference with ___mingw_vfprintf

> Libs\agar-1.3.4-recompile\lib/libag_gui_static.a(file_dlg.o): In function `fprintf':

So this codebase contains its own re-implementation of fprintf (and
presumably other functions in the family)? I would say it is only to
be expected then that such code might be quite hard to build in
environments that differ even slightly from the "normal", or that have
evolved since last tested. Are you sure a Code Blocks build using
current MinGW of this code is even supposed to work?

--tml

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

Jonathan Marsden | 1 Jan 2010 19:41
Gravatar

Re: Avoiding 'pop up' windows at crash.

jdla wrote:

> It is normal behaviour that that test program *can* crash. It's the 
> intent indeed to check if that feature does work or not. If it doesn't 
> work, there's a crash. (*)
> However, when crashing, there's a 'popup' window (created by 'windows') 
> to notify about this crash and give the option to report to MS.
> Also the user has to click 'OK' then.
> Is there any technique or possibility you are aware of to have a mingw 
> compiled program tested (and potentially crashed) completely in the MSYS 
> shell without such 'popups' ?

Disable Windows Error Reporting for this program, or for all programs.
This is not a mingw/MSYS configuration issue, it is a Windows
configuration issue.

(1) Right click on "My Computer".
(2) Click on Properties
(3) In the "System Properties" window, click the "Advanced" tab.
(4) Click the "Error Reporting" button.
(5) Disable error reporting from all programs, or from just this one.

Jonathan

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

Tor Lillqvist | 1 Jan 2010 19:52
Picon
Picon
Favicon

Re: Avoiding 'pop up' windows at crash.

SetErrorMode() might be what you are looking for.
http://msdn.microsoft.com/en-us/library/ms680621%28VS.85%29.aspx

--tml

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

jdla | 1 Jan 2010 20:26
Picon

Re: Avoiding 'pop up' windows at crash.

Tor Lillqvist schreef:
> SetErrorMode() might be what you are looking for.
> http://msdn.microsoft.com/en-us/library/ms680621%28VS.85%29.aspx
>
> --tml
>
>   
Likely !
I'll give it a try and let you know.
Many thanks in any case.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

JonY | 2 Jan 2010 02:57
Picon

Re: undefined reference with ___mingw_vfprintf

On 1/2/2010 01:44, Tor Lillqvist wrote:
>> Libs\agar-1.3.4-recompile\lib/libag_gui_static.a(file_dlg.o): In function `fprintf':
>
> So this codebase contains its own re-implementation of fprintf (and
> presumably other functions in the family)? I would say it is only to
> be expected then that such code might be quite hard to build in
> environments that differ even slightly from the "normal", or that have
> evolved since last tested. Are you sure a Code Blocks build using
> current MinGW of this code is even supposed to work?
>
> --tml
>
>

Hi,

I think Code Blocks is picking up the new headers, but for some reason
using the older mingw libs.

Its possible OP has 2 MinGW install side-by-side, one of them bundled
with Code Blocks, hence a version mismatch of sorts.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

jdla | 2 Jan 2010 09:09
Picon

Re: Avoiding 'pop up' windows at crash.

Tor Lillqvist schreef:
> SetErrorMode() might be what you are looking for.
> http://msdn.microsoft.com/en-us/library/ms680621%28VS.85%29.aspx
>
> --tml
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev 
> _______________________________________________
> MinGW-users mailing list
> MinGW-users@...
>
> This list observes the Etiquette found at 
> http://www.mingw.org/Mailing_Lists.
> We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.
>
> _______________________________________________
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users
>
>   
Tor, thanks a million.
This did exactly what I wanted to obtain.
(I'm coming from the linux side of the house and have poor understanding 
of the windows possibilities).
Jos

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users

jdla | 2 Jan 2010 09:10
Picon

OpenMP/threads

Dear all,

As I hinted in my first post : it seems OpenMP and threads are not 
cooperating well with gcc under mingw.
(this means : it crashes).

Anyone some insight if and when or how this might get resolved ?

For my program I would need ideally both cooperating. It has a guithread 
and some worker threads, the latter I want to speedup using OpenMP.
At now, I can only do this with recent gcc's under Linux.

Jos

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
MinGW-users mailing list
MinGW-users@...

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users


Gmane