Compiling from command line on Mac - Help

BlitzMax Forums/BlitzMax Beginners Area/Compiling from command line on Mac - Help

CandlestoneDave(Posted 2012) [#1]
Hi Guys

I am having a major newbie experience here. I do not know how to compile the final executable on my Mac from the command line. There seems to be very little on this despite vigorous searching on the forums and on the web.

1. I have the .bmk project open (although I have tried it with the project closed)
2. I go to the top menu and select "Program" then "Command Line".
3. In the window that opens I type, "bmk makeapp myapp.bmx" - where 'myapp.bmk' is the name of my project file.
4. I then click the 'OK' button and lo and behold, nothing happens.

The command line window doesn't seem to allow the ability to navigate to specific directories like Terminal does.

I am clueless. Please help.

Regards

Dave


MikeHart(Posted 2012) [#2]
The command line dialog is there to set parameters which are used when you run your app from within the editor.


CandlestoneDave(Posted 2012) [#3]
Thanks for the reply. I guess what I am essentially wanting to do is compile a file application with all of the resource files included in it.

I put in the commands into the command line, such as:

bmk makeapp -r myapp.bmx

I understand the '-r' makes it a release build. Does that mean it contains all the png files etc?

When I click the image of the rocket to build it just builds it as a small application that references the images where they are saved. It isn't a self contained application.

Is there a dummies guide somewhere that takes a newbie through it step by step?


CandlestoneDave(Posted 2012) [#4]
Some additional info. The file size might be right, I only thought it was small, but when I move the application to a folder other than the one it was compiled in, it won't run, which is why I assumed it was trying to reference the original .png files.

Any suggestions would be appreciated. Thanks.


therevills(Posted 2012) [#5]
I understand the '-r' makes it a release build. Does that mean it contains all the png files etc?


Nope, you need to use incbin to make the media inbedded into the application...

http://en.wikibooks.org/wiki/BlitzMax/Modules/BASIC/BlitzMax_runtime#Incbin

Unless you are talking about data in app bundle, which you would need to do something like this:
prefix = ExtractDir(AppFile)+"/../Resources/"
LoadImage(prefix + "image.png")

But you need to compile the app first, then open it up and add your media into the resource folder.


CandlestoneDave(Posted 2012) [#6]
I have already been using incbin. The application runs when I double click on it, but when I move it to another directory it refuses to. It just opens the graphics screen, spins the beachball and then crashes.

Am I doing the right thing.. is it meant to be as simple as

1. typing "bmk makeapp -r myapp.bmx' in the command line screen
2. pressing the build and run button

Cheers


therevills(Posted 2012) [#7]
If you are using the IDE it should be as easy as no. 2. You only really need to use BMK if you are using another tool to write you application.

Can you post some code you are having issue with and the folder structure?

Last edited 2012


CandlestoneDave(Posted 2012) [#8]
Hi therevills

The opening code is below. There is a whole lot of other Incbin lines to include a lot of other images.

Strict

Graphics 1280,800

SetBlend ALPHABLEND

Incbin "data/Titlescreen.png"
Global Titlescreen:TImage=LoadImage("data/Titlescreen.png")

Incbin "data/youDied.png"
Global youDied:TImage=LoadImage("data/youDied.png")


CandlestoneDave(Posted 2012) [#9]
The file structure is:

main folder = "game"
within it is :

- the project file game.bmk
- subfolder "data"

within the data folder are further folders, which are referenced in the incbin lines. In the two incbins mentioned above, the png files are just in the main folder, so the paths are correct.

Thanks


matibee(Posted 2012) [#10]
Your loading operations don't call up the incbin'd files. Change to..

Global youDied:TImage=LoadImage("incbin::data/youDied.png")


CandlestoneDave(Posted 2012) [#11]
Thank you so much. That has fixed the issue.


therevills(Posted 2012) [#12]
Cool! This is what I thought what was happening :)

When I use IncBin I normally do something this:

Global incbinPrefix:String
?Not Debug
    incbinPrefix = "incbin::"
?

Incbin "data/Titlescreen.png"
Global titleScreen:TImage = LoadImage(incbinPrefix + "data/Titlescreen.png")



CandlestoneDave(Posted 2012) [#13]
That's a good idea. It looks a bit more plain english. I just may adopt your technique. Thanks again.