Blitz (4/119)

From:David McMinn
Date:4 Jun 2001 at 23:21:28
Subject:Re: Using libraries

Demon Hell says the moon is made of cheese, but it's actually made of Using libraries

> Problem is, when I first call my program from the CLI, the debugger
> gives me a "GURU ILLEGAL INSTRUCTION" alert, and stops the program! But
> on starting it again, it runs fine.

There are many possibilities for this happening. Anything that trashes
memory, corrupts the stack, plays with Blitz registers, etc, etc can cause
this kind of error.

Could you give us some context about when and how you are making the calls
tothe library?

> I tracked the problem down to where my program first calls a command
> from the library, so I figured it must be down to the way I opened the
> library, using the following line.
>
> libaddr.l=openlibrary_("libs:mhi/mhimaspro.library",0)

You do not need to do this when using external libraries in Blitz. When
you convert the FD file, the Blitz library which is created has some
initialisation code added to it which automatically gets called when the
library i sused in your program. This initialisation code will do the
OpenLibrary(...) for you.

So your code should just look like:

; Example code
DoSomeSharedLibFunction_(blah)
blah
blah
End

Bye



[) /\ \/ ][ [) |\/| © |\/| ][ |\| |\| | dave@blitz-2000.co.uk
http://members.nbci.com/david_mcminn | ICQ = 16827694
I am Pentium of Borg, division is futile - you will be approximated

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie