User forums > General (but related to Code::Blocks)
map class
thomas:
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.
Michael:
--- Quote from: MortenMacFly on March 15, 2006, 02:06:37 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.
--- End quote ---
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
jmccay:
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
davereid20:
--- Quote from: jmccay on March 16, 2006, 03:18:57 am ---Where do you get mingw 4.1.0?
--- End quote ---
Ceniza has 4.1.0 snapshot builds for windows available here. You'll need 7-zip to uncompress them.
thomas:
--- Quote ---#1 screws up gcc's look up according to Thomas Tutone.
--- End quote ---
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... :)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version