why???help me pls!!!
lam
lamyx@public.szonline.net
Thu Sep 2 05:45:00 GMT 1999
dear sir:
ÃÂ ÃÂ ÃÂ I wrote a programe(stl_map.c)
below:
ÃÂ
#include <algorithm> #include
<string> #include <map> #include <iostream>
ÃÂ
using namespace std;
ÃÂ
int main(void) { //ÃÂ ÃÂ ÃÂ map< string,
char*, less<string> >ÃÂ m_st;ÃÂ ÃÂ ÃÂ // for this
declareÃÂ OK.
ÃÂ ÃÂ ÃÂ map< string, string, less<string>
>ÃÂ m_st;ÃÂ ÃÂ ÃÂ // for this declare error
occur!
ÃÂ ÃÂ ÃÂ ÃÂ string
s1("abc"),s2="123";
ÃÂ ÃÂ ÃÂ char t1[]="123";
ÃÂ //ÃÂ ÃÂ ÃÂ
m_st[s1]=t1;ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ // okÃÂ for first
declare ÃÂ ÃÂ ÃÂ m_st[s1]=s2;ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ //
in this line an error occur when link,why??? ÃÂ ÃÂ ÃÂ
cout<<m_st["abc"]<<endl; ÃÂ ÃÂ ÃÂ
ÃÂ ÃÂ ÃÂ return 0; }
ÃÂ
ÃÂ ÃÂ ÃÂ The programe compile with gcc2.8.1 and
libstdc++2.8.1.1(or libstdc++2.8.1)
in SUN_SPARC450/Solaris2.6(command line:g++ stl_map.c),an
error occur:
ÃÂ ÃÂ ÃÂ /usr/ccs/bin/as: "/var/tmp/cc0bUeGV.s",
line 1610: error: can't compute value of ÃÂ an expression involving an
external symbol
ÃÂ ÃÂ ÃÂ The programe can pass in windows_VC6.0
or Linux_gcc. why???
ÃÂ
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
Best Regard
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ lam
ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ ÃÂ
9.2.1999
More information about the Gcc-bugs
mailing list