This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
problem with string class (not string.h vs. String.h)
- To: gnu-win32 at cygnus dot com
- Subject: problem with string class (not string.h vs. String.h)
- From: Steve Lane <mrsteve at nature dot berkeley dot edu>
- Date: Fri, 01 May 1998 11:19:25 -0700
- Organization: U. C. Berkeley
I just downloaded and installed beta 19.1. No problems, everything
went fine. I've been using it to work through "C++ Primer", 3/e (good
book, LOTS of misprints this edition), generally without problems
(i.e. templates, etc. work fine).
However...
This won't work, and it works fine on other compilers (i.e. g++ v. 2.8.1
running
on a DEC Alpha):
in file test.cc:
#include <string>
int main()
{
string str( "string" );
return 0;
}
I get a whole list of errors that look like the following:
mrsteve >> g++ -lg++ -I/Cygnus/b19/include/g++ -o test test.cc
C:\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 `b
asic_string<char, string_char_traits<char> >::~basic_string(void)'
C:\TEMP\cc0010361.o(.text$_$_t12basic_string2ZcZt18string_char_traits1Zc+0x0):te
st.cc: first defined here
(plus about nine more multiply defined class methods, constructors, etc.)
As can be seen from the command line above, this problem is not solved by
linking against the g++ library, or by explicitly including the g++ include
directory. I would LOVE to know what the problem is. The error messages
seem to indicate that something is being multiply defined/included, but I've
been
through the header files some (the #include recursions get pretty hairy
after a bit),
and I couldn't find any obvious problems.
The version info is
mrsteve >> g++ -v
Reading specs from
C:\Cygnus\B19\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\2.7-B
19\specs
gcc driver version 2.7-B19 executing gcc version 2.7-97r2aBeta
and
mrsteve >> uname -a
CYGWIN32_NT CROAKER 4.0 19.1 i686 unknown
Any help would be much appreciated -- thanks in advance!
-Steve Lane
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".