Thiago Negri | 26 Jan 21:34 2013
Picon

SDL and ALUT on Windows: "stdin Bad file descriptor"

I'm trying SDL on Windows, and things are getting really weird.
I can compile the code (links on the end).
When I run it, if I try using `stdin` the program crashes with this message: 

<stdin>: hGetLine: invalid argument (Bad file descriptor)

Is it something to do with SDL itself?
What am I doing wrong? :(


Thanks.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Brandon Allbery | 26 Jan 21:52 2013
Picon

Re: SDL and ALUT on Windows: "stdin Bad file descriptor"

On Sat, Jan 26, 2013 at 3:34 PM, Thiago Negri <evohunz <at> gmail.com> wrote:
I'm trying SDL on Windows, and things are getting really weird.
I can compile the code (links on the end).
When I run it, if I try using `stdin` the program crashes with this message: 

<stdin>: hGetLine: invalid argument (Bad file descriptor)

You haven't even touched SDL at that point in that source code.

If I had to guess, something (possibly a linker option embedded in the SDL binding) is causing your program to be built as a Windows GUI (as opposed to Windows Console) so it has no stdin.  I couldn't tell you much more than that, though; the ways of Windows development are foreign to me.

--
brandon s allbery kf8nh                               sine nomine associates
allbery.b <at> gmail.com                                  ballbery <at> sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Henk-Jan van Tuyl | 27 Jan 00:17 2013
Picon

Re: SDL and ALUT on Windows: "stdin Bad file descriptor"

On Sat, 26 Jan 2013 21:52:03 +0100, Brandon Allbery <allbery.b <at> gmail.com>  
wrote:

> On Sat, Jan 26, 2013 at 3:34 PM, Thiago Negri <evohunz <at> gmail.com> wrote:
>
>> I'm trying SDL on Windows, and things are getting really weird.
>> I can compile the code (links on the end).
>> When I run it, if I try using `stdin` the program crashes with this
>> message:
>>
>> <stdin>: hGetLine: invalid argument (Bad file descriptor)
>>
>
> You haven't even touched SDL at that point in that source code.
>
> If I had to guess, something (possibly a linker option embedded in the  
> SDL
> binding) is causing your program to be built as a Windows GUI (as opposed
> to Windows Console) so it has no stdin.  I couldn't tell you much more  
> than
> that, though; the ways of Windows development are foreign to me.
>

You probably used -optl-mwindows in the compile command, to prevent the  
DOS-shell appearing behind your window.

Regards,
Henk-Jan van Tuyl

--

-- 
http://Van.Tuyl.eu/
http://members.chello.nl/hjgtuyl/tourdemonad.html
Haskell programming
--
Thiago Negri | 27 Jan 02:30 2013
Picon

Re: SDL and ALUT on Windows: "stdin Bad file descriptor"

I didn't use `-optl-mwindows`. I guess the dependency on SDL is doing this.
Anyway, I was trying to print some debug messages to see what was going wrong.
Replaces the debugs message with on-screen messages using `SDL-ttf` package.

Thanks,
Thiago.


2013/1/26 Henk-Jan van Tuyl <hjgtuyl <at> chello.nl>
On Sat, 26 Jan 2013 21:52:03 +0100, Brandon Allbery <allbery.b <at> gmail.com> wrote:

On Sat, Jan 26, 2013 at 3:34 PM, Thiago Negri <evohunz <at> gmail.com> wrote:

I'm trying SDL on Windows, and things are getting really weird.
I can compile the code (links on the end).
When I run it, if I try using `stdin` the program crashes with this
message:

<stdin>: hGetLine: invalid argument (Bad file descriptor)


You haven't even touched SDL at that point in that source code.

If I had to guess, something (possibly a linker option embedded in the SDL
binding) is causing your program to be built as a Windows GUI (as opposed
to Windows Console) so it has no stdin.  I couldn't tell you much more than
that, though; the ways of Windows development are foreign to me.


You probably used -optl-mwindows in the compile command, to prevent the DOS-shell appearing behind your window.

Regards,
Henk-Jan van Tuyl


--
http://Van.Tuyl.eu/
http://members.chello.nl/hjgtuyl/tourdemonad.html
Haskell programming
--

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane