Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in SDL application on Windows #25

Open
EPashkin opened this issue Jun 22, 2014 · 3 comments
Open

Error in SDL application on Windows #25

EPashkin opened this issue Jun 22, 2014 · 3 comments

Comments

@EPashkin
Copy link

Error occurs when attempting to log anything in SDL application

: hPutChar: invalid argument (Bad file descriptor)

I made test application in EPashkin/hslogger_SDL_test bad branch
Problem can be fixed on application side if call removeAllHandlers before any log action (ex. in start setupLogger).
Source of problem is very strange value of stderr. Don't found way detect it, stderr still opened and writable. Simply hPutChar stderr 'g' will also fail.

P.S. Failing handler IMHO created in System.Log.Logger.logTree.
P.P.S. When application started from console (cabal run) it works fine even on WARNING,
but hPutChar stderr 'g' still failing.
(Sorry, was wrong. Error still showing.)

@expipiplus1
Copy link

This is not specific to hslogger and seems to happen in any application linked with SDL2 when run using stack run on windows

@BuBuMan
Copy link

BuBuMan commented Dec 31, 2020

@expipiplus1 Did you find a solution for it?

@expipiplus1
Copy link

@BuBuMan Can't remember, sorry!

Perhaps it's this: haskell-game/sdl2#86 (comment)

(so adding -optl-mconsole might fix it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants