Subject: g++ header file problems
To: None <netbsd-help@NetBSD.ORG>
From: Brook Milligan <brook@trillium.NMSU.Edu>
List: netbsd-help
Date: 06/26/1998 11:12:02
There is an order problem with two of the standard g++ header files.
Included in one order they work; included in the other they don't.
I am not sure what the problem is, how to fix it, or even if this is
the proper forum for mentioning it.  If not, please pass this along to
a more appropriate forum.

The following file demonstrates the problem.

     #ifdef ERROR
     #include <vector.h>
     #include <string>
     #else
     #include <string>
     #include <vector.h>
     #endif

Compile it with either of the following:

    g++ -c test.cc
    g++ -DERROR -c test.cc

In the second case the following errors result:

     In file included from /usr/include/g++/std/bastring.h:571,
		      from /usr/include/g++/std/string.h:6,
		      from /usr/include/g++/string:5,
		      from test.cc:3:
     /usr/include/g++/std/sinst.h:60: ambiguous template instantiation for `operator !=(const char *, const basic_string<char,string_char_traits<char> > &)' requested
     /usr/include/g++/std/sinst.h:60: ambiguous template instantiation for `operator !=(const basic_string<char,string_char_traits<char> > &, const char *)' requested
     /usr/include/g++/std/sinst.h:62: ambiguous template instantiation for `operator >(const char *, const basic_string<char,string_char_traits<char> > &)' requested
     /usr/include/g++/std/sinst.h:62: ambiguous template instantiation for `operator >(const basic_string<char,string_char_traits<char> > &, const char *)' requested
     /usr/include/g++/std/sinst.h:63: ambiguous template instantiation for `operator <=(const char *, const basic_string<char,string_char_traits<char> > &)' requested
     /usr/include/g++/std/sinst.h:63: ambiguous template instantiation for `operator <=(const basic_string<char,string_char_traits<char> > &, const char *)' requested
     /usr/include/g++/std/sinst.h:64: ambiguous template instantiation for `operator >=(const char *, const basic_string<char,string_char_traits<char> > &)' requested
     /usr/include/g++/std/sinst.h:64: ambiguous template instantiation for `operator >=(const basic_string<char,string_char_traits<char> > &, const char *)' requested

Cheers,
Brook