Why won't this module compile?
BlitzMax Forums/BlitzMax Programming/Why won't this module compile?
| ||
bmk makemods -a pub.LWmathsStrict Module PUB.LWmaths ModuleInfo "Version: 1.0.0.1" ModuleInfo "Author: Joshua Klint" ModuleInfo "Copyright: Leadwerks Corporation" ModuleInfo "www.leadwerks.com" Import Brl.Math Function Dbl!(val!) Return val! EndFunction Function Log2#(num#) Return Log(num)/0.693147 End Function Function Round(val#) Local dec# dec#=val-Floor(val) If dec<0.5 Return Floor(val) Else Return Ceil(val) EndFunction Function Bool:Byte(value) If value Return True Else Return False EndFunction |
| ||
Did you try strict off? |
| ||
Still doesn't work. It's in a folder "PUB\LWmaths.mod". |
| ||
Hmmm...the name had to be all lower-case. |
| ||
Hmm normally only if you are on non windows as OSX and Linux are case sensitive, even with module names. |
| ||
I've taken to lowercasing all of my module and directory names. I'm tired of arguing with the compiler. Heh. |
| ||
Wasn't it a no-no to put your own modules under the 'pub' folder? (Thought some of the updates wipe & repopulate this and the brl module folders, but the others are left alone?) |
| ||
Yes its a no no as any update will kick it out into the backup folder again (brl and pub are for Blitz modules not usermade) Another problem is that all modules from brl and pub modserver automatically get imported if you don't exclude them through frameworking. |
| ||
I tried putting my modules in a leadwerks.mod folder and naming them leadwerks.modname, but bmk won't compile them that way. |
| ||
Make a folder: Blitzmax/mod/leadwerks.mod Make a sub folder: Blitzmax/mod/leadwerks.mod/maths.mod Save your file as maths.bmx in this folder, and set the Module name to leadwerks.maths. Import it in your projects using Import leadwerks.maths |
| ||
BMK compiles this module: pub.lwstring BMK will not compile the module when placed here: leadwerks.string I have checked spelling and names enough times that I know that isn't the problem. BMK will not compile any module that is not in "pub" or "brl". I have compiled enough modules that I know how to do it, and I am not naming them wrong or anything. I have a folder in "mods" called "leadwerks.mod". I have a folder in "mod\leadwerks.mod" called "string.mod". I have a file in "mod\leadwerks.mod\string.mod" called "string.bmx". The modulename in "mod\leadwerks.mod\string.mod\string.bmx" is "leadwerks.string". The module compiles fine when placed in the "pub" folder and named correctly. |
| ||
Try turning off quick build, and rebuild ALL modules. It sure sounds like it's something misspelled somewhere, but it could be something else. |
| ||
Why would I rebuild all modules? I am calling bmk directly with a .bat file: bmk makemods -a leadwerks.string |
| ||
Try rebuilding the module(s) from the IDE. Just so you know, I cannot use leadwerks.string as a module identifier. It tells me 'unexpected string literal', calling it 'strings' (everywhere, also folders) makes it compile fine. |
| ||
That won't work even if you placed it in pub. String is a reserved keyword in BM as it is a core type. BM does not seperate between modserver, module names and types (stupidly but it is that way) move your lwstring folder over to leadwerks.mod and change it from Module pub.lwstring to leadwerks.lwstring Its for example not possible to name a type like the module it is in, that won't work as well. |
| ||
Dreamora is right. This makes naming conventions a bit awkward. If I have a module that enhances bank functions, I can't call it leadwerks.bank, because that conflicts with brl.bank. I can call it leadwerks.lwbank, so do I give all my modules a "lw" prefix? I have leadwerks.math3D, but if BRL comes out with a math3D module that's going to break mine. Of course, calling everything "leadwerks.lw_" is pretty redundant. Why even bother with separate folders if each module has to be named uniquely? |
| ||
Thats no problem, there is no naming conflict. BM is scope based, so you could still access both by brl.math3d.xx and leadwerks.math3d.xx But what you can't do is name a type the same as a module and in the specific case of the core types (object, string and all the numeric types), name a module like a type. With all other, fully BM based types within BRL and PUB, there is no problem, those aren't "hardcoded". Only the types etc within brl.blitz are reserved from I've seen (and had to find out the hard way ^^) so far. |
| ||
Nope, bmk will compile leadwerks.lwmath, but it will not compile leadwerks.math. It produces "math.debug.win32.x86.i" then quits, so I know I am not naming anything incorrectly. |
| ||
by rebuilding modules you would most likely get a more usefull output |