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...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

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
position of mpatrol.h, mingw and iostream   Message List  
Reply | Forward Message #883 of 1198 |
Hi,

I have a problem concerning the position of the mpatrol.h in combination
with mingw and iostream, but I'm not sure, whether mingw plays really
a role in that.

The versions, I used are: mingw 3.1.0-1 and mpatrol 1.4.8.

A very short test-program:
===========================================================
// hello.cpp

#include "C:/mingw/include/mpatrol.h" /// <-- Position 1

#include <iostream>
using namespace std;

// #include "C:/mingw/include/mpatrol.h" /// <-- Position 2

int main( int argc , char *argv[] ){
int *vector;
vector = (int*) calloc(32, sizeof(int));
vector[31] = 100;
cout << "hello world, the value is " << vector[31] << endl;
// printf("hello world, the value is %d\n", vector[31]);
free(vector);

return 1;
}
============================================================

As adviced, I linked with "-lmpatrol -lbfd -liberty -limagehlp".

With mpatrol.h in "Position 2" all works very well. I tested a
lot of MPATROL_OPTIONS and I liked very much, what I get!

But with mpatrol.h in "Position 1", which is the same as using the
"-include C:/mingw/include/mpatrol.h" - Flag when compiling
the program, I got the following error (sorry, it's a bit long)

============================================================

In file included from c:/mingw/include/c++/3.2.3/memory:55,
from c:/mingw/include/c++/3.2.3/string:48,
from c:/mingw/include/c++/3.2.3/bits/localefwd.h:49,
from c:/mingw/include/c++/3.2.3/ios:48,
from c:/mingw/include/c++/3.2.3/ostream:45,
from c:/mingw/include/c++/3.2.3/iostream:45,
from hello.cpp:3:
c:/mingw/include/c++/3.2.3/bits/stl_alloc.h: In static member function
`static
void* std::__new_alloc::allocate(unsigned int)':
c:/mingw/include/c++/3.2.3/bits/stl_alloc.h:109: parse error before
`;' token
c:/mingw/include/c++/3.2.3/bits/stl_alloc.h:109: `::<invalid operator>'
undeclared (first use here)
c:/mingw/include/c++/3.2.3/bits/stl_alloc.h: In static member function
`static
void std::__new_alloc::deallocate(void*, unsigned int)':
c:/mingw/include/c++/3.2.3/bits/stl_alloc.h:113: parse error before
`;' token
c:/mingw/include/c++/3.2.3/bits/stl_alloc.h: In member function `void
std::allocator<_Alloc>::construct(_Tp*, const _Tp&)':
c:/mingw/include/c++/3.2.3/bits/stl_alloc.h:700: parse error before
`;' token
c:/mingw/include/c++/3.2.3/bits/stl_alloc.h: In member function `void
std::__allocator<_Tp, _Alloc>::construct(_Tp*, const _Tp&)':
c:/mingw/include/c++/3.2.3/bits/stl_alloc.h:796: parse error before
`;' token
In file included from c:/mingw/include/c++/3.2.3/memory:56,
from c:/mingw/include/c++/3.2.3/string:48,
from c:/mingw/include/c++/3.2.3/bits/localefwd.h:49,
from c:/mingw/include/c++/3.2.3/ios:48,
from c:/mingw/include/c++/3.2.3/ostream:45,
from c:/mingw/include/c++/3.2.3/iostream:45,
from hello.cpp:3:
c:/mingw/include/c++/3.2.3/bits/stl_construct.h: In function `void
std::_Construct(_T1*, const _T2&)':
c:/mingw/include/c++/3.2.3/bits/stl_construct.h:78: parse error before `
static_cast'
c:/mingw/include/c++/3.2.3/bits/stl_construct.h: In function `void
std::_Construct(_T1*)':
c:/mingw/include/c++/3.2.3/bits/stl_construct.h:89: parse error before `
static_cast'
In file included from c:/mingw/include/c++/3.2.3/string:57,
from c:/mingw/include/c++/3.2.3/bits/localefwd.h:49,
from c:/mingw/include/c++/3.2.3/ios:48,
from c:/mingw/include/c++/3.2.3/ostream:45,
from c:/mingw/include/c++/3.2.3/iostream:45,
from hello.cpp:3:
c:/mingw/include/c++/3.2.3/bits/basic_string.tcc: In static member
function
`static std::basic_string<_CharT, _Traits, _Alloc>::_Rep*
std::basic_string<_CharT, _Traits,
_Alloc>::_Rep::_S_create(unsigned int,
const _Alloc&)':
c:/mingw/include/c++/3.2.3/bits/basic_string.tcc:444: parse error
before `)'
token
mingw32-make.exe: *** [hello.o] Error 1

============================================================

I'm really wondering about getting "parse errors"?

So I have some clear questions:

Do "-include mpatrol.h" and "iostream" generally not work together?
(in this case I would have to edit some files ... :-(

Is this a bug, which will be fixed in a next version and I only
have to wait a little bit...?

Is this a kind ob incompatibility of the mingw-version (status:
current) and the mpatrol-version (status: proposed)?

Shall I avoid iostream for all projects in the future?

Have anyone some hints for me?
Thanks in advance

Gerhard













Thu Apr 22, 2004 8:05 am

gph_3d
Offline Offline
Send Email Send Email

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

Hi, I have a problem concerning the position of the mpatrol.h in combination with mingw and iostream, but I'm not sure, whether mingw plays really a role in...
gph_3d
Offline Send Email
Apr 22, 2004
8:06 am

Hello, I'm afraid I can't answer all your questions, but I will say that this problem is not related to mingw. I've seen this same behaviour on linux. In fact,...
ryan p bobko
ryanbobko
Offline Send Email
Apr 22, 2004
12:25 pm

... It seems unusual to put a third-party library's headers where the system headers reside. I don't see any reason why that wouldn't work here--I just don't...
Greg Chicares
chicares
Offline Send Email
Apr 22, 2004
11:09 pm
Advanced

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