Page 1 of 1

1 line program error?

Posted: Thu Dec 13, 2007 10:11 am
by Karbon
messagerequester("Hi","Hello World")

End
i make the executable and run it and a terminal window opens, the message box is displayed but you can't click "OK" on it - have to CTRL+C the terminal to end the program.

What have I missed?

Re: 1 line program error?

Posted: Thu Dec 13, 2007 10:34 am
by IceSoft
Karbon wrote:
messagerequester("Hi","Hello World")

End
i make the executable and run it and a terminal window opens, the message box is displayed but you can't click "OK" on it - have to CTRL+C the terminal to end the program.
What have I missed?
Works here as expected. Ok button can be pressed.

Re: 1 line program error?

Posted: Thu Dec 13, 2007 10:37 am
by michel51
Karbon wrote:
messagerequester("Hi","Hello World")

End
i make the executable and run it and a terminal window opens, the message box is displayed but you can't click "OK" on it - have to CTRL+C the terminal to end the program.

What have I missed?
Works here fine too. No problems.

Posted: Thu Dec 13, 2007 1:28 pm
by Dreamland Fantasy
That should work okay (I'm not in front of my Mac to test it just now).

Make sure that you are using the correct extension (.app) for the executable file name.

Kind regards,

Francis.

Re: 1 line program error?

Posted: Thu Dec 13, 2007 3:02 pm
by michel51
Karbon wrote:
messagerequester("Hi","Hello World")

End
i make the executable and run it and a terminal window opens, the message box is displayed but you can't click "OK" on it - have to CTRL+C the terminal to end the program.

What have I missed?
I have to read the whole posting :oops: .
I tried again, and You are right.

Compiled as *.app is working fine, as expected.
compiled as "unix-executable" opens the terminal first and then the test-window is shown, but the OK-button cannot be pressed. That is because the terminal is in front and not the test-window.

Hm..., very interesting....

Posted: Thu Dec 13, 2007 3:17 pm
by Dreamland Fantasy
Yes, it seems to be a classic pitfall for anyone not familiar with the Mac way of doing things (like myself! :wink: ).

I had a similar problem and it took me ages to figure out that i had to add '.app' to the end of the executable file name.

Kind regards,

Francis.

Posted: Thu Dec 13, 2007 4:49 pm
by Karbon
Rename to .app and get "You can't open this application because the classic environment is no longer supported".

This is a new Mac so it's running 10.5.1

Posted: Thu Dec 13, 2007 5:10 pm
by Dreamland Fantasy
Karbon wrote:Rename to .app and get "You can't open this application because the classic environment is no longer supported".

This is a new Mac so it's running 10.5.1
I'm using Mac OS X 10.5.1 as well.

I remember getting the same error as you, but I can't remember offhand how I resolved it. I'll have a look when I get home tonight and let you know.

Kind regards,

Francis.

Posted: Thu Dec 13, 2007 5:45 pm
by Karbon
OK, so if you put ".app" when you compile it works - if you compile without it first then rename it - it doesn't.

Very strange :-)

Posted: Thu Dec 13, 2007 5:51 pm
by freak
Karbon wrote:OK, so if you put ".app" when you compile it works - if you compile without it first then rename it - it doesn't.

Very strange :-)
A .app is a directory (called bundle), not a single executable.
If you append the .app when compiling, the compiler generates the bundle directory,
else it only creates a single executable.

Posted: Thu Dec 13, 2007 5:54 pm
by Karbon
Ah, well, there ya go.. I didn't realize that.

So is this a "classic" app?

Posted: Thu Dec 13, 2007 6:30 pm
by Karbon
Additionally, "Get Info" tells me it's a PowerPC application. Since it was compiled and is running on an Intel machine I don't know if that is accurate :-)

Posted: Thu Dec 13, 2007 7:04 pm
by Dreamland Fantasy
Karbon wrote:Additionally, "Get Info" tells me it's a PowerPC application. Since it was compiled and is running on an Intel machine I don't know if that is accurate :-)
It is accurate.

PureBasic for the Mac at present does not support the Intel processors and can only produce PowerPC executables. MacOS X interprets the PowerPC code into Intel code in order to be able to run it.

Glad you got your problem sorted! :)

Kind regards,

Francis.

Posted: Thu Dec 13, 2007 7:39 pm
by freak
Karbon wrote:Ah, well, there ya go.. I didn't realize that.

So is this a "classic" app?
You mean classic as in pre-OSX app ?
Nope, its a real OSX application. no classic support needed.

Posted: Thu Dec 13, 2007 7:59 pm
by Karbon
Gotcha. The PowerPC thing is what threw me.. I got all confused with the Mac terminology - Cocoa, Carbon, Classic, .app, Unix application.. What they need is something else to call "a program" :-)