Author Topic: map class  (Read 19511 times)

Offline jmccay

  • Almost regular
  • **
  • Posts: 202
map class
« on: March 15, 2006, 03:56:14 am »
The following code gives me 52 errors.  I am using mingw 3.4.5, and I got the same results with 3.4.4.  What am I missing?

Code
 #include <map>
#include <string>
using namespace std;

typedef std::map<string,int> objPropsMap;

errors:

Code
In file included from C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/map:66,
                 from ptl_interfaces.h:17,
                 from main.cpp:2:
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:157: error: `bidirectional_iterator_tag' does not name a type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:228: error: `bidirectional_iterator_tag' does not name a type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:325: error: `allocator' has not been declared
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:325: error: expected `>' before '<' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:325: error: expected unqualified-id before '>' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:703: error: expected `,' or `...' before '<' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:705: error: `bool ptl::std::operator==(int)' must have an argument of class or enumerated type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:705: error: `bool ptl::std::operator==(int)' must take exactly two arguments
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: In function `bool ptl::std::operator==(int)':
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:706: error: `__x' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:706: error: `__y' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:707: error: `equal' is not a member of `ptl::std'
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: At global scope:
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:713: error: expected `,' or `...' before '<' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:715: error: `bool ptl::std::operator<(int)' must have an argument of class or enumerated type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:715: error: `bool ptl::std::operator<(int)' must take exactly two arguments
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: In function `bool ptl::std::operator<(int)':
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:716: error: `lexicographical_compare' is not a member of `ptl::std'
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:716: error: `__x' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:717: error: `__y' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: At global scope:
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:723: error: expected `,' or `...' before '<' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:725: error: `bool ptl::std::operator!=(int)' must have an argument of class or enumerated type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:725: error: `bool ptl::std::operator!=(int)' must take exactly two arguments
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: In function `bool ptl::std::operator!=(int)':
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:725: error: `__x' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:725: error: `__y' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: At global scope:
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:730: error: expected `,' or `...' before '<' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:732: error: `bool ptl::std::operator>(int)' must have an argument of class or enumerated type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:732: error: `bool ptl::std::operator>(int)' must take exactly two arguments
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: In function `bool ptl::std::operator>(int)':
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:732: error: `__y' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:732: error: `__x' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: At global scope:
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:737: error: expected `,' or `...' before '<' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:739: error: `bool ptl::std::operator<=(int)' must have an argument of class or enumerated type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:739: error: `bool ptl::std::operator<=(int)' must take exactly two arguments
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: In function `bool ptl::std::operator<=(int)':
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:739: error: `__y' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:739: error: `__x' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: At global scope:
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:744: error: expected `,' or `...' before '<' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:746: error: `bool ptl::std::operator>=(int)' must have an argument of class or enumerated type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:746: error: `bool ptl::std::operator>=(int)' must take exactly two arguments
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: In function `bool ptl::std::operator>=(int)':
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:746: error: `__x' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:746: error: `__y' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: At global scope:
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: variable or field `swap' declared void
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: `ptl::std::swap' declared as an `inline' variable
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: template declaration of `int ptl::std::swap'
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: `_Rb_tree' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: expected primary-expression before ',' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: expected primary-expression before ',' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: expected primary-expression before ',' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: expected primary-expression before ',' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: expected primary-expression before '>' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: `__x' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:752: error: `_Rb_tree' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:752: error: expected primary-expression before ',' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:752: error: expected primary-expression before ',' token
Process terminated with status 1 (0 minutes, 2 seconds)
52 errors, 0 warnings
 
OS: WinXP, Win98 SE, & sometimes Linux

a little light reading from the wxWidgets 2.6.2 readme: A detailed 2000-page reference manual is supplied in HTML, PDF and Windows Help form: see the docs hierarchy.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: map class
« Reply #1 on: March 15, 2006, 04:28:29 am »
Missing or corrupted MinGW files, or a weird command line. The code works fine for me (admittedly, I am using 3.4.2).
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: map class
« Reply #2 on: March 15, 2006, 09:42:10 am »
Please provide a full source code file if you want help. The code snippet is not enough. A very "Hello World" application using maps works for me, too. (Sorry.)
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline jmccay

  • Almost regular
  • **
  • Posts: 202
Re: map class
« Reply #3 on: March 15, 2006, 11:10:46 am »
The only thing different/missing is the standard console application.  That is all the code left.  I commented out the rest.  Is there some sort of cache?  I did a clean.  I used the template provided for that.  Morten, what version of mingw are you using?

Here is the complete file:
Code
/**************************************************************************
File: ptl_interfaces.h
Author: Joseph L. McCay
Date: 03/14/2006
Copywrite 2006 All rights reserved
Purpose: This file contains all the interfaces for the Persistence Template Library.

//TODO: Decide on license and place it here.
**************************************************************************/

//TODO decide on how to declare includes!!!



//namespace ptl {
//    #include <string>
#include <string>
#include <utility>
#include <map>
using namespace std;

typedef map<std::string,int> objPropsMap;

    /**
     CLASS: IPerData
     PURPOSE: This interface is used to pass the properties map to the object requirng persistence services.
    */

/*
    class IPerData {
        bool setData(std::map<char,int>& rdata)=0;
        std::map<int,int>& getData()=0;
    };
*/


    /**
     CLASS: IMapper
     PURPOSE: All mapper objects must implement this interface!
    */
/*
    class IMapper {
        bool connect(int num, boost::any *pAny = NULL)=0;
        bool disconnect()=0;
        bool write()=0;
        bool Write(IPerData *)=0;
        std::map<int,int>& read()=0;
        bool read(IPerData*)=0;
        bool Bind()=0;
    };
*/
//}

I commented everything else out.  It is strange because if I create a new file with just that information I gave you, it compiles for me too.  What's different?

jmccay
« Last Edit: March 15, 2006, 11:26:22 am by jmccay »
OS: WinXP, Win98 SE, & sometimes Linux

a little light reading from the wxWidgets 2.6.2 readme: A detailed 2000-page reference manual is supplied in HTML, PDF and Windows Help form: see the docs hierarchy.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: map class
« Reply #4 on: March 15, 2006, 11:13:25 am »
The following code gives me 52 errors.  I am using mingw 3.4.5, and I got the same results with 3.4.4.  What am I missing?

Code
 #include <map>
#include <string>
using namespace std;

typedef std::map<string,int> objPropsMap;

Hello,

It works fine here with GCC 4.1.0. Anyway, it is not necessary to use std:: in front of std::map<string,int> objPropsMap, because you declare already using namespace std;.

Anyway, it is you that posted to Mingw-users list, right  :)? As someone replied you it is possible that your problem is not in the map, but elsenwhere:

Quote
What is ptl_interfaces.h?  It's not referenced in your testcase and it's not any part of the mingw tools[...]

If you post the source code, it would help :).

Best wishes,
Michael

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: map class
« Reply #5 on: March 15, 2006, 12:53:24 pm »
Morten, what version of mingw are you using?
Versions: 3.42, 3.44, 3.45 and 4.10... Yes, I'm nuts. ;-)
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: map class
« Reply #6 on: March 15, 2006, 01:01:55 pm »
I commented everything else out.  It is strange because if I create a new file with just that information I gave you, it compiles for me too.  What's different?
Sorry, I don't get it (maybe becasue I have no coffee today ;-)): The code you sent here compiles, too. By your sentence do you mean that this compiles for you, too or not? And if it compiles for you why do you post this example then?! I'm not offending, I'm asking for clarification, please.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: map class
« Reply #7 on: March 15, 2006, 01:02:04 pm »
Versions: 3.42, 3.44, 3.45 and 4.10... Yes, I'm nuts. ;-)

I must admit that I a a bit surprised... :o

I just have/use 3.4.5 and 4.1.0 (in two separate MinGW installation).

Best wishes,
Michael

sethjackson

  • Guest
Re: map class
« Reply #8 on: March 15, 2006, 01:39:46 pm »
The following code gives me 52 errors.  I am using mingw 3.4.5, and I got the same results with 3.4.4.  What am I missing?

Code
 #include <map>
#include <string>
using namespace std;

typedef std::map<string,int> objPropsMap;

errors:

Code
In file included from C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/map:66,
                 from ptl_interfaces.h:17,
                 from main.cpp:2:
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:157: error: `bidirectional_iterator_tag' does not name a type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:228: error: `bidirectional_iterator_tag' does not name a type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:325: error: `allocator' has not been declared
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:325: error: expected `>' before '<' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:325: error: expected unqualified-id before '>' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:703: error: expected `,' or `...' before '<' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:705: error: `bool ptl::std::operator==(int)' must have an argument of class or enumerated type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:705: error: `bool ptl::std::operator==(int)' must take exactly two arguments
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: In function `bool ptl::std::operator==(int)':
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:706: error: `__x' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:706: error: `__y' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:707: error: `equal' is not a member of `ptl::std'
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: At global scope:
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:713: error: expected `,' or `...' before '<' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:715: error: `bool ptl::std::operator<(int)' must have an argument of class or enumerated type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:715: error: `bool ptl::std::operator<(int)' must take exactly two arguments
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: In function `bool ptl::std::operator<(int)':
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:716: error: `lexicographical_compare' is not a member of `ptl::std'
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:716: error: `__x' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:717: error: `__y' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: At global scope:
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:723: error: expected `,' or `...' before '<' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:725: error: `bool ptl::std::operator!=(int)' must have an argument of class or enumerated type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:725: error: `bool ptl::std::operator!=(int)' must take exactly two arguments
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: In function `bool ptl::std::operator!=(int)':
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:725: error: `__x' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:725: error: `__y' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: At global scope:
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:730: error: expected `,' or `...' before '<' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:732: error: `bool ptl::std::operator>(int)' must have an argument of class or enumerated type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:732: error: `bool ptl::std::operator>(int)' must take exactly two arguments
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: In function `bool ptl::std::operator>(int)':
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:732: error: `__y' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:732: error: `__x' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: At global scope:
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:737: error: expected `,' or `...' before '<' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:739: error: `bool ptl::std::operator<=(int)' must have an argument of class or enumerated type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:739: error: `bool ptl::std::operator<=(int)' must take exactly two arguments
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: In function `bool ptl::std::operator<=(int)':
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:739: error: `__y' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:739: error: `__x' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: At global scope:
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:744: error: expected `,' or `...' before '<' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:746: error: `bool ptl::std::operator>=(int)' must have an argument of class or enumerated type
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:746: error: `bool ptl::std::operator>=(int)' must take exactly two arguments
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: In function `bool ptl::std::operator>=(int)':
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:746: error: `__x' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:746: error: `__y' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: At global scope:
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: variable or field `swap' declared void
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: `ptl::std::swap' declared as an `inline' variable
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: template declaration of `int ptl::std::swap'
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: `_Rb_tree' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: expected primary-expression before ',' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: expected primary-expression before ',' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: expected primary-expression before ',' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: expected primary-expression before ',' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: expected primary-expression before '>' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:751: error: `__x' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:752: error: `_Rb_tree' was not declared in this scope
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:752: error: expected primary-expression before ',' token
C:/development/compilers/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:752: error: expected primary-expression before ',' token
Process terminated with status 1 (0 minutes, 2 seconds)
52 errors, 0 warnings
 

Ok you do using namespace std. The you use std::map etc.

Maybe this instead?
Code: cpp
 
#include <map>
#include <string>

using namespace std;

typedef map<string, int> objPropsMap;

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: map class
« Reply #9 on: March 15, 2006, 02:06:37 pm »
Versions: 3.42, 3.44, 3.45 and 4.10... Yes, I'm nuts. ;-)
I must admit that I a a bit surprised... :o
Well, it's cross-platform development: 3.45 and 4.10 is on Windows (C::B with MinGW), 3.42 and 3.44 is on two Linux boxes (command line GCC with Makefiles) where I cannot update or install packages. 4.10 is for testing purposes only to be "safe for the future".
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: map class
« Reply #10 on: March 15, 2006, 02:09:02 pm »
The error states that bidirectional_iterator_tag is not defined.
Unless you have a really stupid macro somewhere that interferes in an absurd way (unlikely), this has nothing to do with your code (and it has nothing to do with using std:: or not).

Look in your include/c++/3.4.5/bits directory, and make sure you have the file stl_iterator_base_types.h (this is the one that defines bidirectional_iterator_tag). Its MD5 is 4505f2b08a35a49860c807524ac937cd.

If the file exists (it probably does, or else you would see a "file not found" error) and has the correct MD5, add the -H compiler switch to see if the header is actually used.

If nothing helps, untar the MinGW-3.4.5 tgz again, that should fix it for good, anyway.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: map class
« Reply #11 on: March 15, 2006, 02:19:12 pm »
Well, it's cross-platform development: 3.45 and 4.10 is on Windows (C::B with MinGW), 3.42 and 3.44 is on two Linux boxes (command line GCC with Makefiles) where I cannot update or install packages. 4.10 is for testing purposes only to be "safe for the future".
With regards, Morten.

Ah ok, I understand :). Personally, I use GCC 4.1.0 (with backward compatibility tests with GCC 3.4.5) on Windows XP and GCC 4.0.2 on Ubuntu 5.10. But to be sure it would be useful to add on Linux GCC 3.4.4 too :).

Best wishes,
Michael

Offline jmccay

  • Almost regular
  • **
  • Posts: 202
Re: map class
« Reply #12 on: March 16, 2006, 03:18:57 am »
   Ok.  I got it work.  I figured out what I was doing.  The only code I didn't post was the main function file--which turned out to be the problem.  I was editing the wrong file.  I removed ptl_interfaces.h from CB, and coppied it to a new file named ptl_interfaces.hpp.  I added the new file to the project.  I forgot to change the include in the main cpp file.  It was still including the old file.

   Ok, now part 2.  I got the answer as to what was causing all the errors from posting on the mingw users forum.  Basically, the code I was trying to use:

namespace ptl {
//#include <string>
//#include <utility>
#include <map> //#2
using namespace std; //#1
}

doesn't work with mingw.  I don't know if it is supposed to be legal c++.  #1 screws up gcc's look up according to Thomas Tutone.  He also said #2 was erronous to map it into ptl.

  Next,  Where do you get mingw 4.1.0?  I got 3.4.4 floating around my system (older CB installation), and 3.4.5 installed.  I wouldn't mind having 4.1.0 floating around too.  Although, I think I'd just use 3.4.5 the most.  Finally, no more "sleep coding" for me!  I was really tired, and trying to bang something out quickly.  Strickly caffine induced programming late at night from now on.  Thanks for the help, and keep up the good work.
jmccay
OS: WinXP, Win98 SE, & sometimes Linux

a little light reading from the wxWidgets 2.6.2 readme: A detailed 2000-page reference manual is supplied in HTML, PDF and Windows Help form: see the docs hierarchy.

davereid20

  • Guest
Re: map class
« Reply #13 on: March 16, 2006, 05:11:17 am »
Where do you get mingw 4.1.0?

Ceniza has 4.1.0 snapshot builds for windows available here. You'll need 7-zip to uncompress them.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: map class
« Reply #14 on: March 16, 2006, 10:04:53 am »
Quote
#1 screws up gcc's look up according to Thomas Tutone.
Wow, that strikes me odd. Normally I write out std:: explicitely, but I've been using a few timestimes in the past too, and it always worked fine. But then, Thomas probably knows better than me... :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."