0

I puzzled over a simple piece of code which relates to gcc 4.7.4 installation issues or may be to an existing bug in gcc itself...? std::map does not work, the sample code below where Key, Value are both integers fails in less < operator. I have found some posts that sited some issues with comparing std::map keys in gcc 4.7, but nothing really conclusive.

compile options: g++ -g -c -std=c++11 -Wall -static-libstdc++ -o mslarblogger.o -DUSE_JEMALLOC=1 -I.

typedef std::map<int, int>  MySessionMap;

MySessionMap my_sessions_;
my_sessions_[1] = 1;
// core dumping with segmentation fault after the first insertion above in less < operator...

my_sessions_[2] = 2;
my_sessions_[3] = 3;
Dai
  • 141,631
  • 28
  • 261
  • 374
  • What's USE_JEMALLOC for? – Eugene Aug 21 '14 at 23:33
  • Just test `std::map` without the complie options.Is there the same problem? – frank.lin Aug 22 '14 at 03:14
  • Actually just running binary fails but on a different box than the one which the binary was compiled. So the issue is the missing/wrong libs compliant with gcc 4.7 Any quick tips may be where to start to bring the box where the program runs in compliance with gcc4.7? Just running it there, no need to compile. – Apprentice1975 Aug 22 '14 at 18:09

0 Answers0