Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: eos.vss.fsi.com: ford owned process doing -bs Date: Thu, 30 Oct 2003 16:58:40 -0600 (CST) From: Brian Ford X-X-Sender: ford AT eos To: cygwin AT cygwin DOT com Subject: Re: gcc and iostream In-Reply-To: <1067549281.3fa18261b9137@www.nexusmail.uwaterloo.ca> Message-ID: References: <1067549281 DOT 3fa18261b9137 AT www DOT nexusmail DOT uwaterloo DOT ca> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I don't know if any of these will address your problem, but... On Thu, 30 Oct 2003 y2bismil AT engmail DOT uwaterloo DOT ca wrote: > I am using > #include > using namespace std; > I might reverse the order of those two, but I don't know if it matters. I'm not a c++ person. > Its a pretty large project. First, all the sources and compiled into object > files using gcc. Then to link, I've tried both gcc and g++. > You should never compile or link c++ source files with gcc. Use g++. > Both times using -lstdc++ as a paramter. > If you use g++, as you should, this is not necessary. > Yet, I always seem to get iostream errors like: > > : undefined reference to `ostream::operator<<(char const*) > : undefined reference to `_cin' > : undefined reference to `_cout' > :undefined reference to `istream& operator>>(istream&, smanip const&)' > Don't know. > My compile line is: > gcc/g++ > g++ > -mno-cygwin -g -o$(_Target) > -LC:\cygwin\lib\mingw > Don't hand DOS paths to Cygwin utilities (ie. leave off the C:\). And the -mno-cygwin flag makes this redundant, so don't use it. > -Wl,--start-group > -lwsock32 > -lstdc++ > Again, using g++, omit this. > > -Wl,--end-group > Let us know if you try all that and still have problems. -- Brian Ford Senior Realtime Software Engineer VITAL - Visual Simulation Systems FlightSafety International Phone: 314-551-8460 Fax: 314-551-8444 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/