Compiling

Here you can talk about anything related to BBC BASIC, not covered in another category
KenDown
Posts: 141
Joined: Wed 04 Apr 2018, 06:36

Compiling

Post by KenDown »

I've recently downloaded the SDL version of BASIC and have enjoyed playing the 2048 game. However I wanted to compile it to play on another computer but first it objects that it can't copy the fonts, then when I delete reference to them in the "Create application" box it throws up "Internal error 254".

Am I doing something wrong or is there some bar or other "feature" designed to prevent compilation?

Thanks.

KenDown
Posts: 141
Joined: Wed 04 Apr 2018, 06:36

Re: Compiling

Post by KenDown »

Richard very kindly sent me the information below and requested that I post it on this forum:

================
> it objects that it can't copy the fonts

Well, yes, it would! 2048.bbc is designed to run in both 'BBC BASIC for Windows' and 'BBC BASIC for SDL 2.0'. As such it has code to load a Windows font (for BB4W) or a FreeType font (for BBCSDL) according to which platform it is running on.

You will, I'm sure, be aware that the simple way in which the BB4W and BBCSDL 'compilers' scan the program for likely embedded files cannot possibly tell whether the reference to a resource file (whether a font or anything else) is in a piece of 'conditional' code that only gets executed on a particular platform. That is only determined at run-time, hence the 'embedded files' list will inevitably include all such files it finds.

So it is your responsibility to edit the list as appropriate so that any resource files which are irrelevant to the platform you are compiling for are deleted.

> when I delete reference to them in the "Create application" box it throws
> up "Internal error 254".

I cannot reproduce that here. If I delete 'ClearSans-Bold.ttf' from the list the compilation proceeds smoothly and generates the requested application bundle.
==============

I wonder if anyone else has this same problem?

KenDown
Posts: 141
Joined: Wed 04 Apr 2018, 06:36

Re: Compiling

Post by KenDown »

Richard came up with two suggestions. The first was that I use BB4W to compile the program. I did, and it was successful.

The second was an attempt at tracking down the problem, much hindered by my lack of familiarity with SDL. He suggested that I find the compiler program, which turned out to be a second program called compile.bbc in the Examples/Tools directory, and save it with line numbers so that when it threw up an error, we would know the offending line. After a bit of to-ing and fro-ing I managed to do that, but I fear that I am none the wiser! The line reads

Code: Select all

OSCLI "run " + @lib$ + "../zip -r """ + bundle$ + """ *"