From: Hughes, J. <Joh...@at...> - 2005-02-08 12:52:22
|
Stuart/Al, Many thanks - got over that hurdle. I should have figured that one out - although I seem to recall VisualStudio automatically has the std namespace. I have another question - sort of related. I also need to use the Microsoft CString class. This requires the use of the fax's include file. This does not appear in any of the Mingw include directories. John > -----Original Message----- > From: Stuart McNicholas [mailto:mcn...@ys...]=20 > Sent: 08 February 2005 10:16 > To: min...@li... > Subject: Re: [Mingw-users] Use of c++ string >=20 > Hughes, John wrote: > > I'm having problems compiling a cpp program - using the=20 > string class. > >=20 > > Below is a simple extract of the code segment > >=20 > >=20 > > *#include* "debug.h" > > *#include* <time.h> > > *#include* <string> > >=20 > >=20 > > *#include* <sys/types.h> > > *#include* <sys/timeb.h> > >=20 > > HANDLE hTraceFile =3D 0; > >=20 > > string aa =3D "aaa"; > >=20 > >=20 > > The compliation output is below > >=20 > > g++ -c -DBUILDING_DLL=3D1 -DWIN32 -DNDEBUG -D_WINDOWS=20 > -D_MBCS -D_USRDLL > > -DJPCAP_EXPORTS \ > > -I"C:\Program Files\Java\jdk1.5.0"\include -I"C:\Program > > Files\Java\jdk1.5.0"\include\win32 \ > > -ID:\eclipse\workspace\Jpcap_dll\wpdpack\include > > -ID:\eclipse\workspace\Jpcap_dll\include > > -ID:\eclipse\workspace\Jpcap_dll\include\IPv6Kit \ > >=20 > > -IC:\MinGW\include\c++\3.4.2=20 > > -IC:\MinGW\include\c++\3.4.2\bits-IC:\MinGW\include\c++\3.4.2\ext\ > > -o debug.o debug.cpp > > debug.cpp:12: error: `string' does not name a type > > debug.cpp:14: error: `string' does not name a type > >=20 > >=20 > > The <string> header file is found in MinGW \c++\3.4.2=20 > directory - but=20 > > obviously isn't correct for some reason. > >=20 > > Is there anything I need to do to get the compile to work -=20 > or have I=20 > > not installed the correct MinGW include files. > >=20 > >=20 > > John > >=20 >=20 > either put >=20 > using namespace std; >=20 > somewhere in scope or use >=20 > std::string aa =3D "aaa"; >=20 > Stuart >=20 >=20 > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide Read honest &=20 > candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > MinGW-users mailing list > Min...@li... >=20 > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users >=20 >=20 _________________________________________________________________________= _ This e-mail and the documents attached are confidential and intended=20 solely for the addressee; it may also be privileged. If you receive this = e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin = group=20 liability cannot be triggered for the message content. Although the=20 sender endeavours to maintain a computer virus-free network, the sender=20 does not warrant that this transmission is virus-free and will not be=20 liable for any damages resulting from any virus transmitted. _________________________________________________________________________= _ |