On 11/02/11 14:28, 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.

What shell are you invoking from?
If from an Msys shell (and if not, why not?) then note that the line 
buffering in Msys is a bit odd, so you either need to explicitly set 
stdout to unbuffered, or liberally sprinkle fflush(stdout); lines 
throughout your code. I usually do the latter, I think Albrecht and Greg 
prefer the former...

If from a DOS box, then this is a MS Windows "feature"... If you invoke 
a non-console app from a DOS box, the stdio is dropped automatically, so 
you get no output.
You can compile your non-console app as if it were a console app though, 
then the stdio will not be dropped - I think you would need to add 
-mconsole to the link line, though I never do this.
The downside to this is that if you run the app by clicking on it, a 
DOS-box wil then pop up first as your app runs. Which is cosmetically poor..


>
> 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.

Can not say: I use gdb a lot to debug code on Windows, built with mingw 
and running in an Msys shell, and it has always Just Worked.



_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to