-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Embedding Julia in a Windows application without console #28820
Comments
I am seeing on Windows 7 (on a bit different context) If stdin is not available, Julia should not stop. |
If I replace this line Correctness of this solution is unclear to me. |
If you call
jl_init()
from a Windows application without a console, Julia 0.7 and 1.0 will abort the application after trying and failing to duplicate an invalid stdio handle. Julia 0.6 was less strict (and possibly less correct) about this but at least the apparent result was that things worked and stdout/stderr output just disappeared.This doesn't seem like an unreasonable use case for embedding and
jl_init
should handle it gracefully. If it can't easily be fixed it should at least be documented.The easiest workaround I have found is to call
AllocConsole()
beforejl_init()
, with the predictable drawback that you get a window that you might not want. As a workaround for the workaround you can hide the console window withShowWindow(GetConsoleWindow(), SW_HIDE)
, but not without a brief flickering between creation and hiding.For more details, see https://discourse.julialang.org/t/embedding-jl-init-exits-on-windows-for-julia-0-7/13819
The text was updated successfully, but these errors were encountered: