This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

#include <std/string.h>


I was playing around a bit with the STL and was trying to build a
simple test of the "map" template.  The following example works great
under Linux, but fails under cygwin32-b19.  I was rummaging around the
mailing list archives and found a few vague references to the problem,
but no information on what to do.  Here's my code tidbit:

// a simple STL test

#include <map.h>
#include <std/string.h>
#include <stdio.h>

main() {
    map < string, int, less<string> > mymap;
    string name;
    int value;

    mymap["curt"] = 1;
    mymap["doug"] = 2;
    mymap["dan"] = 3;

    printf("curt = %d\n", mymap["curt"]);
    printf("doug = %d\n", mymap["doug"]);
}

The initial problem is that <std/string.h> doesn't exist in cygwin32,
but if I copy over <std/string.h> from my linux system I get a cascade
of errors that is included at the end of this message.

Am I supposed to be including something else instead of
<std/string.h>?

Life would really suck if I couldn't get past this problem. :-(

Thanks in advance,

Curt.
-- 
Curtis Olson                        University of MN, ME Dept.
curt@me.umn.edu                     
http://www.menet.umn.edu/~curt      Try Linux!

Get your free flight sim:  http://www.menet.umn.edu/~curt/fgfs/


N:\Cygnus\B19\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(cstrmain.o): In function `bool _lt<char, string_char_traits<char> >(basic_string<char, string_char_traits<char> > const &, basic_string<char, string_char_traits<char> > const &)':
/home/noer/src/97r2/devo/libstdc++/std/bastring.h:515: multiple definition of `bool operator<<char, string_char_traits<char> >(basic_string<char, string_char_traits<char> > const &, basic_string<char, string_char_traits<char> > const &)'
M:\temp\59\cc0010411.o(.text$__lt__H2ZcZt18string_char_traits1Zc_RCt12basic_string2ZX01ZX11T0_b+0x0):maptest.cc: first defined here
N:\Cygnus\B19\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(cstrmain.o): In function `$_t12basic_string2ZcZt18string_char_traits1Zc':
/home/noer/src/97r2/devo/libstdc++/std/bastring.h:163: multiple definition of `basic_string<char, string_char_traits<char> >::~basic_string(void)'
M:\temp\59\cc0010411.o(.text$_$_t12basic_string2ZcZt18string_char_traits1Zc+0x0):maptest.cc: first defined here
N:\Cygnus\B19\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(cstrmain.o): In function `_t12basic_string2ZcZt18string_char_traits1ZcPCc':
/home/noer/src/97r2/devo/libstdc++/std/bastring.h:151: multiple definition of `basic_string<char, string_char_traits<char> >::basic_string(char const *)'
M:\temp\59\cc0010411.o(.text$__t12basic_string2ZcZt18string_char_traits1ZcPCc+0x0):maptest.cc: first defined here
N:\Cygnus\B19\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(cstrmain.o): In function `basic_string<char, string_char_traits<char> >::assign(char const *)':
/home/noer/src/97r2/devo/libstdc++/std/bastring.h:190: multiple definition of `basic_string<char, string_char_traits<char> >::assign(char const *)'
M:\temp\59\cc0010411.o(.text$assign__t12basic_string2ZcZt18string_char_traits1ZcPCc+0x0):maptest.cc: first defined here
N:\Cygnus\B19\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(cstrmain.o): In function `basic_string<char, string_char_traits<char> >::assign(char const *, unsigned int)':
/home/noer/src/97r2/devo/libstdc++/std/bastring.h:188: multiple definition of `basic_string<char, string_char_traits<char> >::assign(char const *, unsigned int)'
M:\temp\59\cc0010411.o(.text$assign__t12basic_string2ZcZt18string_char_traits1ZcPCcUi+0x0):maptest.cc: first defined here
N:\Cygnus\B19\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(cstrmain.o): In function `_t12basic_string2ZcZt18string_char_traits1ZcRCt12basic_string2ZcZt18string_char_traits1Zc':
/home/noer/src/97r2/devo/libstdc++/std/bastring.h:145: multiple definition of `basic_string<char, string_char_traits<char> >::basic_string(basic_string<char, string_char_traits<char> > const &)'
M:\temp\59\cc0010411.o(.text$__t12basic_string2ZcZt18string_char_traits1ZcRCt12basic_string2ZcZt18string_char_traits1Zc+0x0):maptest.cc: first defined here
N:\Cygnus\B19\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(cstrmain.o): In function `_t12basic_string2ZcZt18string_char_traits1Zc':
/home/noer/src/97r2/devo/libstdc++/std/bastring.h:144: multiple definition of `basic_string<char, string_char_traits<char> >::basic_string(void)'
M:\temp\59\cc0010411.o(.text$__t12basic_string2ZcZt18string_char_traits1Zc+0x0):maptest.cc: first defined here
N:\Cygnus\B19\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(cstrmain.o): In function `basic_string<char, string_char_traits<char> >::Rep::grab(void)':
/home/noer/src/97r2/devo/libstdc++/std/bastring.h:71: multiple definition of `basic_string<char, string_char_traits<char> >::Rep::grab(void)'
M:\temp\59\cc0010411.o(.text$grab__Q2t12basic_string2ZcZt18string_char_traits1Zc3Rep+0x0):maptest.cc: first defined here
N:\Cygnus\B19\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(cstrmain.o): In function `basic_string<char, string_char_traits<char> >::Rep::data(void)':
/home/noer/src/97r2/devo/libstdc++/std/bastring.h:69: multiple definition of `basic_string<char, string_char_traits<char> >::Rep::data(void)'
M:\temp\59\cc0010411.o(.text$data__Q2t12basic_string2ZcZt18string_char_traits1Zc3Rep+0x0):maptest.cc: first defined here
N:\Cygnus\B19\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(cstrmain.o): In function `basic_string<char, string_char_traits<char> >::Rep::release(void)':
/home/noer/src/97r2/devo/libstdc++/std/bastring.h:72: multiple definition of `basic_string<char, string_char_traits<char> >::Rep::release(void)'
M:\temp\59\cc0010411.o(.text$release__Q2t12basic_string2ZcZt18string_char_traits1Zc3Rep+0x0):maptest.cc: first defined here
N:\Cygnus\B19\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../libstdc++.a(cstrmain.o): In function `basic_string<char, string_char_traits<char> >::rep(void) const':
/home/noer/src/97r2/devo/libstdc++/std/bastring.h:120: multiple definition of `basic_string<char, string_char_traits<char> >::rep(void) const'
M:\temp\59\cc0010411.o(.text$rep__Ct12basic_string2ZcZt18string_char_traits1Zc+0x0):maptest.cc: first defined here
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]