Interface?

BlitzMax Forums/BlitzMax Programming/Interface?

Tricky(Posted 2008) [#1]
I've tried to code a small module for BMax
Documenting it works.
Compiling it works
Writing a program and making FrameWork detect the need of the module works

Including it into a program works not.

The compiler complains about that it cannot find the interface.

I did look into other modules, and found some .i files and I think those are the files the compiler means. I did look into them in textwrangler but it's abracadabra to me.

What am I supposed to do? Giving that module up and just transferring the code into a regular import file, or is there an automated way to get that file created?


SebHoll(Posted 2008) [#2]
BlitzMax modules need to be organized in a very specific way in order to get the compiler to pick them up.

Say if your module was called Tricky.MyFirstModule, you'll need to create and copy your source files into the following folder:

BlitzMax\mod\tricky.mod\myfirstmodule.mod\myfirstmodule.bmx

...where myfirstmodule.bmx is the root file of the module, and should import all other files your module needs to work. Best to keep file paths lowercase to avoid problems of case-sensitive file systems.

You'll also need to add the following line to the top of myfirstmodule.bmx if you haven't done so already:

Module tricky.myfirstmodule
Finally, once you've done all that, run "Build Modules" from MaxIDE (found under the 'Program' menu), and you should see, amongst any other module builds, the lines...

Archiving: myfirstmodule.debug.win32.x86.a

...

Archiving: myfirstmodule.release.win32.x86.a

BlitzMax should then have generated all the .i and .a files required for the module to work. Then and only then will the module be in a state for you to import into your project using:

Import Tricky.MyFirstModule
See the page on 'Modules' available from MaxIDE, under the 'Languages' help tree node.


Tricky(Posted 2008) [#3]
The .a files are created
The .i files are not

The rest is done exactly as you said, but the .i files are not created


(I did this in MacOS PPC, I haven't tried this in Windows yet)


I figured the .i should have been created automatically, but strangely that didn't happen for some reason... :S