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 Date: Fri, 31 Oct 2003 10:08:48 +0100 From: "Gerrit P. Haase" Reply-To: "Gerrit @ cygwin" Organization: Esse keine toten Tiere X-Priority: 3 (Normal) Message-ID: <133687559107.20031031100848@familiehaase.de> To: y2bismil AT engmail DOT uwaterloo DOT ca CC: cygwin AT cygwin DOT com Subject: Re: gcc and iostream In-Reply-To: <1067549281.3fa18261b9137@www.nexusmail.uwaterloo.ca> References: <1067549281 DOT 3fa18261b9137 AT www DOT nexusmail DOT uwaterloo DOT ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hallo y2bismil, Am Donnerstag, 30. Oktober 2003 um 22:28 schriebst du: > I'm having a linking problem with GCC and iostream. I'm not sure if it has > anything to do with cygwin, so I'll check here. > I am using > #include > using namespace std; > 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++. Both times using > -lstdc++ as a paramter. 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&)' [...] > My compile line is: > gcc/g++ > -mno-cygwin -g -o$(_Target) > -LC:\cygwin\lib\mingw > -Wl,--start-group > -lwsock32 > -lstdc++ > > -Wl,--end-group Put the libraries to the end of the linkline: gcc/g++ -mno-cygwin -g -o$(_Target) -Wl,--start-group -LC:\cygwin\lib\mingw -lwsock32 -lstdc++ -Wl,--end-group And I'm not sure if this works with Cygwin gcc/ld: -LC:\cygwin\lib\mingw Gerrit -- =^..^= -- 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/