Building Modules (duck for cover)

BlitzMax Forums/BlitzMax Beginners Area/Building Modules (duck for cover)

Ant(Posted 2006) [#1]
Eek. I know there have been loads of posts about this but I cant get it working.

I've got this at hte top of my bmx file


I've also made a directory in BlitzMax\mod\pub.mod\profile.

Now I've read that you save the bmx in this directory and then build modules from the IDE - but my build modules option is greyed out...there are a couple of tutorials on this but none seem to work for me.
Can anyone point me in the right direction?


Dreamora(Posted 2006) [#2]
Moduleinfo etc are within a Rem - EndRem block.

To build modules:

Install MingW
Add the MingW\bin directory to the paths environment variable
Add the MingW directory to a new environment variable called MingW


Ant(Posted 2006) [#3]
I'm only building modules from BMax code - thought you only had to install MingW if you were making modules from C etc?


Ant(Posted 2006) [#4]
sorry, which version of MingW do I need to install if I need to install it? MingW Runtime I guess? or MingW utilities..there are few listed here..

http://www.mingw.org/download.shtml#hdr2


Diablo(Posted 2006) [#5]
http://blitzmax.com/Community/posts.php?topic=53442

click on http://prdownloads.sourceforge.net/mingw/MinGW-3.1.0-1.exe?download


Dreamora(Posted 2006) [#6]
Ant: Yes you need it to build C source ... the problem is many of the BM core modules already import c sources ;-)


Ant(Posted 2006) [#7]
ok thanks guys - Diablo, link doesnt work ;-(


Diablo(Posted 2006) [#8]
strange. neither* of them? if you cick on the second one it should bring up a sourceForge - server download list.

if the first one dont work...
PC users wishing to build their own modules will need to install the MinGW C/C++ compiler package.

* Download and install MinGW 3.1.0 from www.mingw.org

The current download can be found here:

prdownloads.sourceforge.net/mingw/MinGW-3.1.0-1.exe?download

Note: Do not use a later version of MinGW. Due to ongoing issues with C++, you may have trouble linking with 'prebuilt' modules if you do.

* Edit your PATH environment to include the MinGW/bin directory.

* Create a MINGW environment variable that points to the MinGW root directory.

And that should be it! You should now be able to use the 'build modules' feature in the IDE.

Bye,
Mark Sibly
WinXP, DX9.0b, P4/3G, 512M, Radeon 9800
MacOS10.3, G5/1.8G, 768M, GeForce 6800 Ultra



Ant(Posted 2006) [#9]
ok, guys got he 2nd to work.

Right I got the build modules option working - No i'm not sure whether I clicked rebuild all by mistake, but that is what it appears to be doing. Can I not just build my own module?

BTW this is the tutorial I've been following:
http://www.blitzmax.com/Community/posts.php?topic=42290


Diablo(Posted 2006) [#10]
no - it will build all the modules first time round (and when you snyc modules). use ctrl-d shortcut in case you think your going to hit the wrong option.


Ant(Posted 2006) [#11]
I'm saving the module in this directory:
C:\Program Files\BlitzMax\mod\pub.mod\bot.mod\firstmodule.mod

and telling it to build which it is, but the files that are being built are not being built in the same directory as the bmx files.....?


Diablo(Posted 2006) [#12]
umm. it shouldnt build.

i bet the output is saying
Building Modules

Process complete


^- That means it hasnt built anything, which it cant in your case. copy bot.mod folder into bmax/mod folder and then it should build it and output somthing like this:

Building Modules
Compiling:firstmodule.bmx
flat assembler  version 1.64
3 passes, 469 bytes.
Archiving:firstmodule.debug.win32.a
Compiling:firstmodule.bmx
flat assembler  version 1.64
3 passes, 301 bytes.
Archiving:firstmodule.release.win32.a

Process complete


your bmax/mod folder should look like this:



WHY WOULDNT IT BUILD

because it doesnt build modules in a third generation module folder, i dont think it even looks thier.


Ant(Posted 2006) [#13]
OK thanks guys it works! So all my own modules have to go in this directory - you cant put them in the pub.mod?

Thanks again for the help and patience.


Diablo(Posted 2006) [#14]
you can but your problem was that the actual module source code was in a folder like:

BlitzMax/mod/pub.mod/bot.mod/myfirstmoudle.mod <- here

if it was like

blitzmax/mod/pub.mod/myfirstmodule.mod <- here

that would be fine and will work.

as i said, it doesnt compile third gen modules (for no better way of putting it). i.e.

yourmodulestuff.mod/amodule.mod <- two gens
pub.mod/amodule.mod <- two gens


Dreamora(Posted 2006) [#15]
It does gen third gen modules without any problem. The module declaration only has to be correct.

module pub.myfirstmodule or
module bot.myfirstmodule for the above (and the core bmx file must be myfirstmodule.bmx within myfirstmodule.mod)


Diablo(Posted 2006) [#16]
Your saying that code in

BlitzMax/mod/pub.mod/bot.mod/myfirstmodule.mod/

compiles.

if you are - it doesnt on my computer - no matter how i declear the module.

module pub.bot.myfirstmodule
module pub.myfirstmodule <- that would never work
module bot.myfirstmodule

[edit]

In fact it doesnt even know anything about any source code in myfirstmodule.mod/ i could type a load of rubish and it wouldnt have any errors.

AND yes i have tested it

[/edit]


Dreamora(Posted 2006) [#17]
The structure must be:

/mod/pub.mod/myfirstmodule.mod/ OR
/mod/bot.mod/myfirstmodule.mod/

Within this there must be a file myfirstmodule.bmx

This file must have the following line at top

module pub.myfirstmodule OR
module bot.myfirstmodule


Your mentioned method above won't work, it only accepts modserv.modulename for naming.


Diablo(Posted 2006) [#18]
oh i see you count mod/ as a gen.

pub.mod/bot.mod/myfirstmoudle.mod/
|Gen 1 | Gen 2 | Gen 3 |

thats how i looked at it.