CIB wrote:
> When compiling a fltk program with MinGW, I'm suffering two problems.. The 
> first is that no output to stdout will work, a printf at the start of the 
> program will simply output nothing.
> 
> The second is that gdb will crash. When starting the program in gdb, it will 
> simply exit with a runtime error. I figure this is a bug in gdb, but since 
> I'm only getting it with fltk apps, it's likely connected to a problem with 
> FLTK, too. This problem even occurs with the fltk demo apps, so it's either a 
> general problem with FLTK, or something going wrong with my build environment.

        Under windows, programs can be 'windows' or 'console' apps:

        "Windows" apps don't have access to stdout/stderr, and 'background' 
themselves.
        But when clicked on from a GUI, they open without a DOS window, which 
is usually
        what people want.

        "Console" apps have access to stdout/stderr, and remain in the 
foreground,
        but when 'clicked on' from a GUI, they open a DOS window so that 
stdout/err
        can be seen. This is easier for debugging, but usually not good for 
people
        who want to point and click to run the app. (They don't usually want to
        see the DOS window)

        This choice is made at link time.
        With the Microsoft compiler, there's two linker flags:
        /subsystem:windows vs. /subsystem:console to control this.

        I think the equivalent in MinGW is the -mwindows flag for 'windows'
        app, and I think if you leave that flag off, you get a console app.
        (Not sure, others here are more familiar with it)

        Both types of apps can open GUIs, depends on the behavior you want.

        Sounds like the apps you're working with were compiled as 'windows'
        apps, whereas you're expecting them to be console.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to