Compiling C???

BlitzMax Forums/BlitzMax Beginners Area/Compiling C???

Pineapple(Posted 2006) [#1]
Hiya all, I've just followed Chris's tutorial about compiling C with BMax. First, I installed Dev-CPP, which comes with the mingw32 compiler, then I made 2 files, one for the C code, and one for Max code (Their both in the same folder, and tried to build it, then it threw up an error:-

Build Error: failed to compile C:/Documents and Settings/Dabz/My Documents/Max/CTest/callb.c

Do you need to set the path for the compiler in Blitz? Have I totally missed the obvious (again...lol)

Any help would be great! :)

Dabz

PS I'm using Max 1.20


FlameDuck(Posted 2006) [#2]
Do you need to set the path for the compiler in Blitz?
Yup. It's either that, or make sure MinGW's bin path is in your search path. Or both.


Chris C(Posted 2006) [#3]
you really dont need dev-cpp, just mingw there was a post by mark about setting this up can anyone remember where it is?


EOF(Posted 2006) [#4]
Marks post was essentially this:

Download and install MinGW 3.1.0-1
Edit your PATH environment to include the MinGW/bin directory
Create a MINGW environment variable that points to the MinGW root directory
You should now be able to use the 'Build Modules' feature in the IDE


Pineapple(Posted 2006) [#5]
Thanks Jim... Just what I was looking for! ;)

Dabz

EDIT: Works a charm! :D


Chris C(Posted 2006) [#6]
yay!

@jim brown - dude! wheres the linux version of this invaluable utility!!!
(I can help with this)


EOF(Posted 2006) [#7]
Check your email ...


simonh(Posted 2006) [#8]
Mark's post is at the top of the module tweaks forum now (used to be at the top of the updates forum).


AD(Posted 2006) [#9]

Download and install MinGW 3.1.0-1
Edit your PATH environment to include the MinGW/bin directory
Create a MINGW environment variable that points to the MinGW root directory
You should now be able to use the 'Build Modules' feature in the IDE



I downloaded the mingw, double clicked on it (no confirmation) -- but how do you do the rest, is this Blitz Max or elsewhere? How do you make MINGW environment vairable and use "build modules" feature?

Thanks.


AD(Posted 2006) [#10]
Okay, I was able to install the right MinGW, this installed to c:\mingw

I added to "PATH" environment variable the phrase ";MinGW/bin"

I added an environment variable "MINGW" with the phrase "c:\mingw" as the path.

The Build modules bit is now usable; but now when I press CTRL+D (in bmax) it says that:



Building Modules
Compiling:blitz_app.c
Build Error: failed to compile C:/Program Files/BlitzMax/mod/brl.mod/blitz.mod/blitz_app.c
Process complete



Why is blitz_app.c now failing?


AD(Posted 2006) [#11]
I have fixed it now, I followed the tutorial on

http://www.greyaliengames.com/framework/technical.html#build

It turns out I put the MINGW variable in the wrong box.

I have now got the string grid function to work.