No Image
No Image
No Image
Mac OS X, SQLiter and Blitzmax Print E-mail
Saturday, 03 March 2007

The saga begins...

Here's the situation. You've been programming PC's for years and you've been lured to Apple for all the really good reasons that are out there to make the switch. Suddenly you're in an environment where everything looks great - but even simple things like installing an application suddenly need brain work or a decent Google search. That's me right now and if that's you as well - read on.

1. Installing and updating Blitzmax

  • Download and install XCode tools from the Apple developer site . Joining is free by the way, so don't stress!
  • Download the latest Blitzmax from the home site. Make sure you remember to select the correct processor version. It will in all likelihood be 'Intel OS X'. Complete Newcomer's Hint: to install, download, open the Blitzmax virtual drive on your desktop, drag the contained folder to your Applications folder. Then download and apply the latest Blitzmax patches (just double click on them to execute the installer). Unmount the Blitzmax virtual drive when done.
  • Syncmods and remake all modules from the IDE as per usual

2. Compiling modules

  • Open a Terminal (Applications>Utilities>Terminal) and add your Blitzmax bin folder to your PATH environment.

This for me resulted in a painful struggle with Vim (the new vi) - a struggle you really don't need to go through. Instead, try:

echo 'export PATH="$PATH:/Applications/Blitzmax/bin"' >> ~/.bash_profile

The idea is that you are redirecting the output of the echo straight to the end of the .profile file, sidestepping the need for an editor at all. Exit then restart your Terminal (I think you need to do this as the Terminal loads your profile each time it starts) and type

echo $PATH

to see if that worked.

If not, try:

echo 'export PATH="$PATH:/Applications/Blitzmax/bin"' >> ~/.profile

as I'm not too sure which is the correct profile filename for bash (someone let me know)? [Edit: René informs me that .profile is the global setting and .bash_profile is your individual user setting] If neither of these works and you are justifiably scared of vi and its clones, try TextWrangler

3. Compiling SQLiter 

Download and place the pyropixel.mod and tm.mod folders in your Blitzmax/mod folder. To do this you may need an Unrar application such as StuffIt . I used the imaginatively named UnRar.

You should now be able to type

bmk makemods -a tm

bmk makemods -a pyropixel

without the world coming crashing down on your head. Well, in theory... Because in fact, in all likelihood you will get an error complaining that "Timeout" in line 301 of tm's main.c is undefined. And guess why? Because it really is undefined!

To fix this, we have to get our hands dirty under tm's bonnet. Digging through the main.c code you'll find a compiler #ifdef #else switch that explains the error. On the PC, HAVE_USLEEP (and hence SQLITE_MIN_SLEEP_MS) is defined differently than on the Mac. Thus on the PC, the switch sees to it that this offending section of code is never compiled. 

My fix is to guess that Timeout was once a global that changed into a function argument somewhere along the line. Tea Monkey if you are still out there, feel free to step in and set me straight on this! Thus simply replace the evil line

//int timeout = (int)Timeout;

with (copied from just above)

int timeout = ((sqlite3 *)ptr)->busyTimeout;

and rebuild. Good luck!

 
< Prev   Next >
No Image
No Image No Image No Image
No Image
© 2009 Gibbon Games
No Image