Hello all,

I'm getting a really weird problem with I/O under MSYS. I've got a C++ program compiled with -mwindows, which among other things, asks for a password.

After much mucking, I got a snippet of code that did what I wanted from the cURL project, but the getch() function doesn't quite work: it just keeps gobbling characters from God knows where, instead of asking me. I thought that it might be the doing of MSYS' shell, so I tried running my program under the ol' MS-DOS shell, but then there's no output at all! I tried fflush()ing stdin and stdout before doing getch, but it doesn't do anything.

What might I be doing wrong? Oh, and by the way, if I use -ggdb when compiling and then try running the program, it barfs on me.

The command I use for linking is:

g++ -o scenario-client src/FileDownloader.o src/client.o src/ConsoleSecretsAgent.o src/SecretsAgent.o lib/getpass.o -lssl -lcrypto -L/mingw/lib -lneon -lssl -lcrypto -lws2_32 -lws2_32 -lz -L/mingw/lib -lxml2 -lz -liconv -lws2_32 -mwindows

For compiling, I use stuff like:

g++ -Wall -I/mingw/include/neon -Isrc -Ilib -ggdb -DNDEBUG -c -o src/SecretsAgent.o src/SecretsAgent.cpp

And then GDB says this:

$ gdb ./scenario-client.exe
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
An internal GDB error was detected.  This may make further
debugging unreliable.  Quit this debugging session? (y or n) n

Create a core file containing the current state of GDB? (y or n) n

(gdb) c:/cygmnt/prj/pkg/src/gdb/mingw32/gdb/dwarf2read.c:985: gdb-internal-error: read_comp_unit_head: dwarf from non elf file

I'm a bit weirded out by all this. Might it be the fault of one of the libraries? I compiled them all myself under mingw, so I don't think it's a problem of binary compatibility.