Search the web
Sign In
New User? Sign Up
mpatrol · mpatrol library discussion group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Getting mpatrol to work with MinGW / Dev-C++?   Message List  
Reply | Forward Message #880 of 1198 |
Re: [mpatrol] Re: Getting mpatrol to work with MinGW / Dev-C++?

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.




Thu Apr 15, 2004 12:12 am

chicares
Offline Offline
Send Email Send Email

Forward
Message #880 of 1198 |
Expand Messages Author Sort by Date

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. ...
algo_dos
Offline Send Email
Aug 19, 2003
5:52 pm

... course. You can find ... MinGW gcc. I have ... right. The closest I ... that I could not ... Downloads page; that ... have the libs, I'm ... Unix-centric,...
gph_3d
Offline Send Email
Apr 14, 2004
1:50 pm

... [trimmed and reformatteed] ... The customary advice on <mingw-users@...> is to get things working on the command line first. Often that...
Greg Chicares
chicares
Offline Send Email
Apr 15, 2004
12:12 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help