Modules: Query

BlitzMax Forums/BlitzMax Beginners Area/Modules: Query

DannyD(Posted 2006) [#1]
Hi,
I'd like to experement with this module .. http://www.blitzbasic.com/codearcs/codearcs.php?code=1511

How do I go about adding the module to blitzmax ? There is no step by step guide to adding modules.

Thanks in advance.


Perturbatio(Posted 2006) [#2]
create a folder called Deps in your mod folder
create a folder called osxspeech in that folder
create a file called osxspeech.bmx inside that and put the module source in it.
and create a file called speechmod.c and put the appropriate source in that.

Build modules and then that should be that.


DannyD(Posted 2006) [#3]
thanks mate, just what I needed.


DannyD(Posted 2006) [#4]
did as suggested above:

Next problem :( :
Identifier 'speech_init' not found.

when I compile the following
]
The speech_init() function is included within speechmod.c.I've build and rebuilt all modules but it still gets stuck above.


Brucey(Posted 2006) [#5]
try adding
import Deps.osxspeech



DannyD(Posted 2006) [#6]
tried but got :

Compile Error
Can't find interface for module 'deps.osxspeech'

So to recap:
BlitzMax-->mod-->Deps-->osxspeech--> contains osxspeech.bmx & speechmod.c


DannyD(Posted 2006) [#7]
tried but got :

Compile Error
Can't find interface for module 'deps.osxspeech'

So to recap:
BlitzMax-->mod-->Deps-->osxspeech--> contains osxspeech.bmx & speechmod.c


Perturbatio(Posted 2006) [#8]
ok, change all folders and filenames to lowercase and change the module declaration (Module Deps.osxspeech) to lowercase as well.


DannyD(Posted 2006) [#9]
Thanks but same thing:
Identifier 'speech_init' not found.
I think it's getting to the .c file but stopping there .


deps(Posted 2006) [#10]
Ok. Didn't have the module since I reformated my mac not long ago. But I downloaded my old source and gave it a try.

Here is what you have to do:

1) Rename the Deps folder in mod/ to Deps.mod
2) Rename the osxspeech folder in mod/Deps.mod/ to osxspeech.mod
3) Look in the codearchive again, I have updated the bmx file so it compiles under blitzmax 1.14
4) Build modules.
5) Remember to Import Deps.osxspeech in your code

Hope you have fun with the module.


Perturbatio(Posted 2006) [#11]
oops, yeah .mod :)


Eric(Posted 2006) [#12]
When you make a mod.. Will the IDE Highlight the functions of the module or not? What is the benefit of making modules vise just including BMX files?


Dreamora(Posted 2006) [#13]
Modules are compiled by GCC which is higher optimized than the blitz compiler.
Additionally, you can create documentation for it following the DocMods rules ... this then would create the needed entries for the highlight file as well


Eric(Posted 2006) [#14]
oh ok thanks for the help. :)


DannyD(Posted 2006) [#15]
Everything working just fine now, thanks everyone.


Romanski(Posted 2009) [#16]
I get this error in speechmod.c when I build the modules:

Compile Error

2: error: invalid preprocessing directive #Include


Brucey(Posted 2009) [#17]
#Include

That should be lower-case "I".
Which implies the file was probably created as a .c or .h file in the IDE but not saved, closed, and re-opened, and *then* edited.

There's a small bug in the IDE where it assumes that if you create a new file, you are creating a .bmx file. So it applies text formatting to anything you type (like capitalising keywords). Even if you save an emtpy file with a .c extension, for example, and then type your code. You need to save the empty file, close it and re-open, then start editing - only then does it realise you aren't editing a .bmx file.

Anyway... that's why the file is probably formatted incorrectly.

:-)