Module Interface Errors

BlitzMax Forums/BlitzMax Beginners Area/Module Interface Errors

William Drescher(Posted 2010) [#1]
Okay, so I've been using BlitzMax for a few years and I STILL don't understand what causes BlitzMax to give me the error "Cannot find interface for module <module_name_here>".

I made a module a few days ago and it worked the first time I put it in the "mod" folder, then I made another module in the EXACT same way, but when I try to use the Import command, I get the interface missing error. How do I fix this?


plash(Posted 2010) [#2]
Well, first off, let's see the path to your module folder and code.
Secondly, what does the header of the main module source look like (Module, ModuleInfo, Imports, etc.)?


William Drescher(Posted 2010) [#3]
First bit of info, the modules are on my MacBook Pro, not sure if that makes a huge difference, but it probably does.

Module path: ~/BlitzMax/mod/coolstuff.mod/CoolColors.mod/
Testing code path: ~/Blitz Projects/CoolColors Test/Test.bmx

Module's Header:
' CoolColors.bmx

Rem
bbdoc:
End Rem
Module CoolStuff.CoolColors

ModuleInfo "Blah"

Import BRL.Max2D

' Module starts



plash(Posted 2010) [#4]
And have you compiled the module (MaxIDE, Program -> Build Modules)?


William Drescher(Posted 2010) [#5]
Yes, and it compiles with no errors at all.


plash(Posted 2010) [#6]
OK. I've never run into this before, because I always use lowercase paths.

Something in the BlitzMax utils doesn't like the case of the module path (interface files are not being generated).
To fix this, lowercase the path to the module and the main source (~/BlitzMax/mod/coolstuff.mod/coolcolors.mod/coolcolors.bmx).

I also suggest you post a bug report; though lowercase path names should always be used (for portability reasons), I do not think it is outlined as a requirement.

EDIT: Quote from the docs:
Modscope should be a unique name (for example, the name of your organization or company) and is used to group together modules provided by a common source. Both modscope and modname should be valid identifiers. Also, to prevent issues with case sensitive filesystems such as Linux's, it is recommended that modscope and modname be lowercase.

So it is not a requirement, but obviously one of the utils lowercases the path when it tries to write certain files (and does not create the entire path beforehand).

It should be suggested to make it a requirement for path names to be lowercase for modules.


William Drescher(Posted 2010) [#7]
It should also be clarified which operating systems are case sensitive, such as Linux based operating systems like Ubuntu and it's family, Mac OS, Red Hat, etc.

EDIT:
Changing the mod scope and name and the bmx file to lowercase seemed to worked.


plash(Posted 2010) [#8]
It should also be clarified which operating systems are case sensitive, such as Linux based operating systems like Ubuntu and it's family, Mac OS, Red Hat, etc.
Unix-based operating systems are case-sensitive, Windows is not. I do not see why this information should be in a programming language's documentation.

The developer should know how his/her operating system works.