How to create/compile a module ?
Monkey Forums/Monkey Programming/How to create/compile a module ?
| ||
How do you create/compile a module - I just get the usual "Function Main not found" |
| ||
You do not compile modules in Monkey. Modules source code is just joined to regular code when you do compile an App that uses the module, so no need to compile them separately. That said, you should know that Monkey does only compiles really used code. It has a very very efficient dead code removal. So, if any part of your module is not being actually used by the app you're compiling, it won't be compiled. That means that potential syntax error won't be detected. |
| ||
The other problem is that my base program can't find the module code - it keeps wanting to look in the base program directory and not .mod Solved it - the module name was in quotes... |
| ||
Yes, Import with quotes is meant to be used to copy elements to the data folder. It's used by Mojo to copy the DrawText bitmap font into the Apps data folders (just as an example). In order to import modules, just use the module name. |
| ||
Never knew about import with quotes. It's a nice option if you are aiming at a bunch of targets and you hate the idea of including extraneous resources! |