From: Luke D. <cod...@ho...> - 2002-07-03 09:14:07
|
The "-mwindows" flag means that your program uses the GUI subsystem instead of the console subsystem. Programs in the GUI subsystem normally have no standard input or output handles so anything you print goes nowhere. I am not 100% sure, but I don't think -mwindows is needed for multithreaded programs: you should use -mthreads though (both when compiling and linking). For debugging, I think you can still capture the output of your program by redirecting its output to a file. Luke ----- Original Message ----- From: "Chirayu Krishnappa" <roc...@gm...> To: <min...@li...> Sent: Wednesday, July 03, 2002 4:39 PM Subject: [Mingw-users] string streams with -mwindows > Hi everyone, > > First off, I thank Mr. Oscar and Mr. Luke for their input on the problems I > faced with wxWindows & gcc 3.1. I've switched back to gcc 2.95.3-6 for the > present :) Sorry to write back after so many days considering the immediate > response you guys gave me. > > I'm now facing another weird problem with stringstreams and the -mwindows > flag. (gcc 2.95.3-6 now.) It took me some time to reproduce the problem as > I had this flag in the Jamfile but was compiling the test cases manually :( > > #include <iostream> > #include <sstream> > #include <fstream> > > using namespace std; > > int main (int argc, const char ** argv) { > ifstream g ("c:/config.sys", ios::in); > ostringstream ss; ss << g.rdbuf (); cout << ss.str (); > g.close(); > return 0; > } > > The problem is this. Without -mwindows, it dumps c:\config.sys. With > -mwindows, there is NO output. Debugging gets me as far as line 713 of > stl_alloc.h at which point the debugger hangs (using the Insight debugger.) > (That line is "static alloc __node_allocator_dummy_instance;" inside a > #ifdef __STL_WIN32THREADS.) > > I think I need to use -mwindows as my program is multi-threaded. Can > someone suggest a work around? > > Thanks for your time, > Chirayu. > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > No, I will not fix your computer. > http://thinkgeek.com/sf > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users > |