Projects with multiple files
BlitzMax Forums/BlitzMax Beginners Area/Projects with multiple files
| ||
Hello all, Just bought BlitzMax after deciding C++ really was too much of a headache for game development. Anyway, I wondered if anybody could point in the direction of how to use the IDE to manage projects with multiple files. E.g., how do I let "main.bmx" access my list of global variables in "globals.bmx"? I can't seem to find anything. Thanks in advance, Matt. |
| ||
Welcome MogwinsInclude "globals.bmx" |
| ||
Thanks, I just found that with the BLIde on-line help. Do I need to worry about multiple dependencies? In C++, I'd put... " #ifndef _GLOBALS_ #define _GLOBALs_ #include "otherdependences.h" " at the start of each file. |
| ||
If you are using the project settings in Blide you dont even need the Include. Whatever you say is a project file is included automaticaly in the order you declare them as project files |
| ||
Hmmm, I am using the BLIde project settings and both files are included, but I need the Include "globals.bmx" line in order to avoid a compiler error. It's not really a bit deal, but any idea why? |
| ||
because BlitzMax is set up differently than C++, it compiles one file and checks for imports and includes in the file and then compiles them and links them to the file. you can also use the Import command. When using Import, if the compiler doesn't detect any changes in the imported file, it won't recompile it. |
| ||
Using BLIde: I recomend you to add a: Import "globals.bmx" at the begining of your main program BMX file, and you'll get done. the project manager in BLIde is there to create projects that generate more than one exe or module. If your project has only a program (with one or more BMX files), just add the appropiate include or incbin in the main bmx file, and any other included file will be also loaded when opening the project. |
| ||
Ah, thanks, I'll do that. |