create executable?

BlitzPlus Forums/BlitzPlus Beginners Area/create executable?

Ice T.(Posted 2006) [#1]
I dont get it. I hit create executable then I save it, when I double click it it says it has encounterd a problem and needs to close when its working fine in blitz+, I would really like to email things I make to freinds and family for them to see how far I have gotten with programming. can anyone help?(>_<)


xlsior(Posted 2006) [#2]
It's possible that the executable can't find the required image files -- are you launching the exe from the same folder as where your source files were located?


Buggy(Posted 2006) [#3]
Also, Ice T, it stinks but many email services don't allow you to email executables because they may be viruses.


Ice T.(Posted 2006) [#4]
source files?


CS_TBL(Posted 2006) [#5]
source file = your code

e.g. if this is the location of your sourcecode:

c:\Blitzplus\

and you have some bla=LoadImage("hero.jpg") in your code, then this hero.jpg has to be in the same dir as your sourcecode e.g. c:\Blitzplus\

If you create an .exe and move this exe to another dir, say, e:\stuff\ then the exe searches that hero image in e:\stuff\ .. and ofcourse it might not be there. This is why Blitzmax has incbin btw, no more loose files everywhere.

In case you're loading stuff (images, sounds, maps, everything) it's best to have a minor check routine to see if it's loaded correctly.

E.g.

bla=LoadImage("moo.jpg")

If Not bla Notify "moo.jpg not found!"

I tend to use functions for that to make things easier for me.

E.g.
Function LoadImage2(file$)
  bla=LoadImage(file$)
  If Not bla
    Notify "y0! wazzaaaah! where's teh "+file$+" file gone eh?"
    End
  EndIf
  Return bla
End Function



Ice T.(Posted 2006) [#6]
okay, the place where I load my images,sounds and music from, gotcha!