Question for GCC programmers

David Bowskill davidbow at tpg.com.au
Sat Oct 9 12:03:51 BST 2010


Thank you Lisa again for more valuable help.
What do think of MinGW as a compiler to produce Windows executables ? I
have not tried this package yet and would appreciate your opinion on it
I assume that the code you sent to me for switching between terminal raw
and cooked states would still work with MinGW.
Regards
David Bowskill

On 09/10/10 15:25, Lisa Milne wrote:
> On Sat, 09 Oct 2010 14:26:31 +1100
> David Bowskill <davidbow at tpg.com.au> wrote:
>
>   
>> Thanks Lisa for your reply, my requirement I gather is not that
>> unusual. Since you enlightened me on the concepts of  'raw' or
>> 'cooked' terminals, I have found several other sources on this as
>> follows:
>> http://osr507doc.sco.com/en/OSUserG/_How_to_get_a_character.html
>> http://stackoverflow.com/questions/421860/c-c-capture-characters-from-standard-input-without-waiting-for-enter-to-be-pre.
>> There are others as well. I wish to be able to compile the code to
>> run under MSWindows (ugh!) for friends to use, so the solution must
>> satisfy this. Thanks again for your invaluable help.
>> Regards
>> David Bowskill
>>     
> Hi David,
> I believe there are curses/ncurses libraries for windows as well as
> Linux/Unix, so again that's one option.
>
> However there is also windows conio.h header, which includes a getch()
> and _getch() ( the latter being the reccomended one as the former is
> deprecated ) which do what you want (I believe, I rarely code for
> windows). In this case you'll need to use preprocessor directives to
> ensure only the code for the target OS is compiled:
>
> #ifdef _WIN32
> 	/* do windows specific code here */
> #else
> 	/* do Linux/Unix/Posix code here */
> #endif
>
>   



More information about the ubuntu-au mailing list