|
Hi Greg,
you wrote:
> 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
> so something worked.
Bingo, that worked!
But why "-lbfd -liberty -limagehlp"?
I searched the mpatrol-manual for this phrases and get
some hints in the form:
"if the mpatrol library was built ... then link with...",
but that really doesn't help me, because - as you know:
I used the binaries.
>> #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?
I'm no expert on this area, I just linked all libraries, which
I found in the mpatrol-package... Obviously that was wrong.
-------------------------------------------
>> (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?
I omitted both: the "- include mpatrol.h" _and_ all four libraries
mentioned above. With "your method", the program runs perfectly!
------------------------------------------------------------------
> 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.
Originally I started with compiling mpatrol from the source.
My try was:
to edit the \built\windows\makefile:
AR = ar
LD = $(CC)
CFLAGS = -I$(SOURCE) -I$(TOOLS) # removing -nolog
OFLAGS = # removing -Ogt
The compiler starts compiling some files, but then it stops when compiling
"inter.c":
../../src/inter.c: In function `void* __mp_alloc(unsigned int, unsigned
int,
alloctype, char*, char*, long unsigned int, char*, unsigned int,
unsigned
int)':
../../src/inter.c:863: `sbrk' undeclared (first use this function)
../../src/inter.c:863: (Each undeclared identifier is reported only once
for
each function it appears in.)
mingw32-make.exe: *** [inter.obj] Error 1
------------------------------------------------------------
So I was very happy, when I found the binaries at mingw.org\download.shtml!
But thanks for your advice anyway.
I think I should start learning more about "-lbfd -liberty -limagehlp".
Thanks a lot for your answer. You made me happy.
Gerhard
|