1 line program error?

Mac OSX specific forum
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

1 line program error?

Post 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?
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
User avatar
IceSoft
Addict
Addict
Posts: 1699
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Re: 1 line program error?

Post 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.
Belive! C++ version of Puzzle of Mystralia
Bug Planet
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

Re: 1 line program error?

Post 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.
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
User avatar
Dreamland Fantasy
Enthusiast
Enthusiast
Posts: 335
Joined: Fri Jun 11, 2004 9:35 pm
Location: Glasgow, UK
Contact:

Post 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.
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

Re: 1 line program error?

Post 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....
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
User avatar
Dreamland Fantasy
Enthusiast
Enthusiast
Posts: 335
Joined: Fri Jun 11, 2004 9:35 pm
Location: Glasgow, UK
Contact:

Post 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.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post 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
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
User avatar
Dreamland Fantasy
Enthusiast
Enthusiast
Posts: 335
Joined: Fri Jun 11, 2004 9:35 pm
Location: Glasgow, UK
Contact:

Post 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.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post 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 :-)
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
freak
PureBasic Team
PureBasic Team
Posts: 5950
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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.
quidquid Latine dictum sit altum videtur
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Ah, well, there ya go.. I didn't realize that.

So is this a "classic" app?
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post 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 :-)
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
User avatar
Dreamland Fantasy
Enthusiast
Enthusiast
Posts: 335
Joined: Fri Jun 11, 2004 9:35 pm
Location: Glasgow, UK
Contact:

Post 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.
freak
PureBasic Team
PureBasic Team
Posts: 5950
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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.
quidquid Latine dictum sit altum videtur
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post 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" :-)
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Post Reply