--- In mpatrol@yahoogroups.com, "algo_dos" <algo_dos@y...> wrote:
> Hello,
> We are trying to put together a simple "beginner's kit" for a C++
course. You can find
> the requirements and history below, at the end of this message.
>
> My current problem is getting mpatrol to work with Dev-C++, i.e.
MinGW gcc. I have
> tried to build mpatrol several times, but never managed to do it
right. The closest I
> got was when using Greg's GNUmakefile, but I still got a few errors
that I could not
> work around after a few hours at it.
>
> Then I found the (precompiled) mpatrol package on the MinGW
Downloads page; that
> one comes with an installer and everything. Perfect! But now that I
have the libs, I'm
> not being able to link my small test programs to mpatrol.
>
> I've read the mpatrol docs and examples, but they are either quite
Unix-centric, or
> (when Windows-specific) somewhate cryptic to me.
Hi,
that text was posted by "algo_dos" about one year ago and it describes
exactely my situation today:
I installed mingw 3.1.0-1 and mpatrol 1.4.8 and then
I created a "very simple" hello-world-program
===================================
// hello.cpp
#include <stdio.h>
#include <stdlib.h>
int main(){
int *vector; // <--
vector = (int*) calloc(32, sizeof(int)); // <--
vector[1] = 100; // <--
printf("hello world, the value is %d\n", vector[1]);
free(vector);
return 1;
}
===================================
...
and a "very simple" makefile, where I added all libraries,
which are mentioned in the manual and which
I could found in the mpatrol-package:
===================================
#makefile
# warning-flags
WFLAGS = -g -Wall -pedantic
#include-flags
IFLAGS = -include C:/mingw/include/mpatrol.h
#library-flags
LFLAGS = -lm -lmpalloc -lmpatrol -lmpatrolmt -lmptools
hello.exe: hello.o
g++ -o hello.exe hello.o $(LFLAGS) $(WFLAGS)
hello.o: hello.cpp
g++ -c -o hello.o hello.cpp $(IFLAGS) $(WFLAGS)
===================================
This will compile, but if I try to run it, the program crashes and
produces an unknown "software exception"!
(Of course, without the mpatrol-stuff it works fine.)
Dear "algo_dos", maybe you have solved "your problem"
and now have an idea for this problem?
Has anyone a hint for me, what is wrong in the example above?
Have I forgotten a library - have I to keep a special order?
Has the above mentioned "beginner's kit" become reality in the
meantime! Where can I find it?
Thanks for all help in advance
(I'm sure, it must only be a tininess, but an important one...)
Gerhard