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

--app:gui gives an error on osx. #2576

Closed
hakanderyal opened this issue Apr 20, 2015 · 15 comments
Closed

--app:gui gives an error on osx. #2576

hakanderyal opened this issue Apr 20, 2015 · 15 comments

Comments

@hakanderyal
Copy link
Contributor

Latest devel, echo "hello world" app, no custom configuration.

# nim c --app:gui try.nim
# ...
# [Linking]
# clang: error: unknown argument: '-mwindows'
# Error: execution of an external program failed
@dom96
Copy link
Contributor

dom96 commented Jun 4, 2015

What is the equivalent of -mwindows for clang? Is there one?

@refi64
Copy link
Contributor

refi64 commented Jun 4, 2015

@mjoud
Copy link

mjoud commented Dec 22, 2015

I just hit this error on Linux when building a gui app with Nim/gcc. It's pretty clear from the gcc docs that this option is available only for MinGW and Cygwin targets.

@dom96
Copy link
Contributor

dom96 commented Dec 22, 2015

Looks like you are correct @mjoud. Any ideas how to achieve the same thing on Mac OS X/Linux?

@mjoud
Copy link

mjoud commented Dec 22, 2015

When I think about it, Is --app:gui necessary at all on platforms other than win? No console window opens when executing program compiled without --app:gui (by double-clicking). I rarely do gui-programming so I haven't given this any thought earlier.

@Araq
Copy link
Member

Araq commented Dec 22, 2015

On Mac my UI application opens a console window ...

@mjoud
Copy link

mjoud commented Dec 22, 2015

Well, at least it's not necessary on Linux (which should be documented), so we're back at the OS X issue.

@johnnovak
Copy link
Contributor

Confirming the issue with nim 0.13.0 on OS X 10.11.3 (El Capitan). After removing the -mwindows flag I can compile just fine, but opening the generated executable from Finder still opens a console window.

@dom96
Copy link
Contributor

dom96 commented Jun 5, 2016

I think in order to get rid of a console window on OS X you need to put your application in an App Bundle (``myProgram.app`).

@dom96
Copy link
Contributor

dom96 commented Jun 5, 2016

BTW I don't think this is to do with installation.

@dom96 dom96 removed the Installation label Jun 5, 2016
@johnnovak
Copy link
Contributor

I don't think you need to put the app inside a bundle just to prevent the console window from showing. For example, check out the glfw project—all their example applications compile to single executable files on OS X (no bundle), yet they don't open a console window when launched either from Finder or the command line.

@fredrikhr
Copy link
Contributor

@PMunch and I discovered in the wxnim repo that the --app:gui also is problematic on Linux. IIRC the same error message popped up on Linux as well (@PMunch correct me if I'm wrong)

So on Linux --app:gui should simply be equivalent to --app:console (or no --app argument at all) as far as the compiler backend is concerned

@PMunch
Copy link
Contributor

PMunch commented Apr 4, 2017

Yeah, I'm getting this on Linux as well. The reason for this is that Linux doesn't really differentiate between GUI and non-GUI programs as mjoud points out. So at least on Linux this flag should just not do anything.

@PMunch
Copy link
Contributor

PMunch commented Apr 4, 2017

I've had a bit of a look around for compiling terminal-less GUI programs on OSX. And I'm not entirely sure what glfw does to work around this. I found someone asking about how Python does it and that's basically because it has an interpreter which is an app already. The same applies to apple-script. But for compiled programs I haven't been able to find anything but wrapping it up in a app file or a shell script like this: http://stackoverflow.com/questions/1810497/hide-console-for-tkinter-app-on-osx.

@andreaferretti
Copy link
Collaborator

With latest devel, this compiles fine on Mac, but opening the generated executable from Finder still opens a console window (what should it actually do, since it just echoes hello world?)

@Araq Araq closed this as completed in d270245 Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants