Is this a bug? about multimap

code:#include <map>int main(){std::multimap<int, float> coll;coll.insert(std::make_pair(2, 22.3f));return 0;}compile with CC command . get some errorcompile with g++ command. OKwhy?BestD.Y
[291 byte] By [dyroro] at [2007-11-26 10:59:56]
# 1
Try to use -library=stlport4 command line option. Without this option you use old implementation of c++ std library - libCstd.2.1.1. You need to use this old library only if you have to maintain binary compatibility with some third party libraries or you own old binary code.
Atanasyan at 2007-7-7 3:13:29 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
When I use -library=stlport4 command line option, <cmath> can not fond.how to do? all of the <cmath> change to <math.h>?BestD.Y
dyroro at 2007-7-7 3:13:29 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3

What version of compiler and OS do you use? I've just checked test case below by Sun C++ 5.6 - 5.9 on Solaris 10. Also I would like to see all command line options which you use to compile.

[code]

#include <cmath>

int main()

{

double d = 0;

std::sin(d);

}

[/code]

Atanasyan at 2007-7-7 3:13:29 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 4
Sorlaris10 X86 and Sun Studio 11THXBEST
dyroro at 2007-7-7 3:13:29 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 5
Has the problem disappeared?If you still cannot use <cmath> with -library=stlport4 please show me the command line options. For example explicit specification of paths to c++ std library header files might confuse compiler.
Atanasyan at 2007-7-7 3:13:29 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 6
here is my command optionsCFLAGS = -w -library=stlport4 -DXT_CODE -Dhp700v9 -DXOPEN_CATALOG -DSYSV -g -mt -D_HPUX_SOURCE THXBEST
dyroro at 2007-7-7 3:13:29 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 7
Can you compile my test case with <cmath> or even it shows an errors message?
Atanasyan at 2007-7-7 3:13:29 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 8
Try inserting the following at the beginning of your code (before other include statments)#include <stdcomp.h>#undef _RWSTD_NO_MEMBER_TEMPLATES
Andrew_Robb at 2007-7-7 3:13:29 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 9

No, do NOT do that.

If you attempt to modify any of the library configuration macros, you wind up with declarations in the headers that do not match what is in the library.

In addition, the otherwise dead code enabled in the headers has never been compiled or tested by Sun. If you run into problems, you are on your own.

If you need a more standard-conforming library, you can use STLport that also comes with the compiler. Add the option

-library=stlport4

to every CC command line, compiling and linking.

As noted in the documentation, the default libCstd and STLport are mutually exclusive. You cannot use both in the same program.

clamage45 at 2007-7-7 3:13:29 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 10

No, it is not a bug, it is a 'documented feature' (i.e. a known bug that they do not intend to fix).

See http://developers.sun.com/sunstudio/articles/cmp_stlport_libCstd.html for an explanation of what parts of the standard C++ language are missing from Sun Studio. This includes the template copy constructor for std::pair.

Andrew_Robb at 2007-7-7 3:13:29 > top of Java-index,Development Tools,Solaris and Linux Development Tools...