gph_3d wrote:
>
> --- In mpatrol@yahoogroups.com, "algo_dos" <algo_dos@y...> wrote:
[trimmed and reformatteed]
> > My current problem is getting mpatrol to work with
> > Dev-C++, i.e. MinGW gcc.
The customary advice on <mingw-users@...>
is to get things working on the command line first. Often
that narrows the problem down to porting a command-line
solution to the Dev-C++ IDE, which should be tractable.
> > 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.
I see I still have the OP's 2003-08-19 message flagged for
a response that I didn't find the time to write then. Here
I would have suggested posting the diagnostics verbatim.
> > Then I found the (precompiled) mpatrol package on the
> > MinGW Downloads page; that one comes with an installer
> > and everything. Perfect!
OK, looking at
http://www.mingw.org/download.shtml
I see source along with a binary
mpatrol-1.4.8-src.tar.bz2
mpatrol-1.4.8-2003.07.21-1.exe
but I can't readily find a description of how the binary
was built.
> > But now that I have the libs, I'm not being able to
> > link my small test programs to mpatrol.
Concrete detail would make it easier to help.
> > I've read the mpatrol docs and examples, but they are
> > either quite Unix-centric, or (when Windows-specific)
> > somewhate cryptic to me.
They don't give a step-by-step process for building on
msw without using the ms compiler. But you can set up
a *nix-style environment on msw and follow the *nix
instructions. Grep the documentation for '-lbfd':
there are only three occurrences, and you want to
ignore the HP-UX thing and add '-limagehlp'.
> 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
It's good to cite versions. Those sound OK.
> I created a "very simple" hello-world-program
[snipped]
Cutting and pasting your code, I do this
C:/tmp[3]$/MinGW/bin/g++ -c -ggdb hello.cpp
C:/tmp[0]$/MinGW/bin/g++ -o hello.exe hello.o -L/local/lib -lmpatrol -lbfd
-liberty -limagehlp
C:/tmp[0]$./hello
C:/tmp[0]$ls -l mpatrol.log
-rw-rw-rw- 1 Win32 Mingw32 4581 Apr 14 19:49 mpatrol.log
so something worked.
> 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
I never do anything like that myself--I follow mpatrol
manual [4.1/2] and just relink. Seems simpler that way.
> #library-flags
> LFLAGS = -lm -lmpalloc -lmpatrol -lmpatrolmt -lmptools
Looks like you're linking non-threaded and threaded
mpatrol libraries. And doesn't '-lmpalloc' defeat the
whole purpose?
> 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.)
Exactly what mpatrol-stuff do you omit? The header and
the libraries both? What happens if you try the method I
used above?
> 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?
Library order matters crucially to the gnu linker.
IIRC the BFD library comes in many incompatible
versions, and one MinGW distribution had one that
didn't work with mpatrol, but I believe that got
fixed--if that were your problem, you'd get linker
diagnostics.
I suspect that the gcc C++ ABI has changed since
the downloaded library was built. That would
explain mysterious behavior if true. Try building
the library from source.