public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gcc and iostream
@ 2003-10-30 22:35 y2bismil
  2003-10-31  2:26 ` Brian Ford
  2003-10-31 10:00 ` Gerrit P. Haase
  0 siblings, 2 replies; 14+ messages in thread
From: y2bismil @ 2003-10-30 22:35 UTC (permalink / raw)
  To: cygwin

Hi all,

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 <iostream>
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>><int>(istream&, smanip<int> const&)'

Below is the output of gcc/g++ -print-search-dirs
**************************************************
install: /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/
programs:
=/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/:/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/:/usr/lib/gc
c-lib/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/3.3.1/:/usr/lib/gcc/i686-pc-cygwin/:/usr/lib/gcc-l
ib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygwin/bin/i686-pc-cygwin/3.3.1/:/usr/lib/gcc-lib/i686-p
c-cygwin/3.3.1/../../../../i686-pc-cygwin/bin/
libraries:
=/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/:/usr/lib/gcc/i686-pc-cygwin/3.3.1/:/usr/lib/gcc-l
ib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygwin/lib/i686-pc-cygwin/3.3.1/:/usr/lib/gcc-lib/i686-p
c-cygwin/3.3.1/../../../../i686-pc-cygwin/lib/:/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../i686-p
c-cygwin/3.3.1/:/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../:/lib/i686-pc-cygwin/3.3.1/:/lib/:/us
r/lib/i686-pc-cygwin/3.3.1/:/usr/lib/
************************************************
My compile line is:
gcc/g++
   -mno-cygwin  -g -o$(_Target)
   -LC:\cygwin\lib\mingw
   -Wl,--start-group
   -lwsock32
   -lstdc++   
   <files needed to be linked>
   -Wl,--end-group    

I doubt this is a code problem, though its always possible.  I think its some
setup option or something like that.

any ideas?  
Thanks,


Yamin

----------------------------------------
This mail sent through www.mywaterloo.ca

--
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/

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: gcc and iostream
@ 2003-10-30 22:41 Timothy C Prince
  0 siblings, 0 replies; 14+ messages in thread
From: Timothy C Prince @ 2003-10-30 22:41 UTC (permalink / raw)
  To: y2bismil; +Cc: cygwin

possibly out-dated gcc code?  check your namespaces?


: undefined reference to `ostream::operator<<(char const*)
: undefined reference to `_cin'
: undefined reference to `_cout'
:undefined reference to `istream& operator>><int>(istream&, smanip<int> const&)'


Tim Prince

--
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/

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2003-10-31 21:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-30 22:35 gcc and iostream y2bismil
2003-10-31  2:26 ` Brian Ford
2003-10-31  7:20   ` Gary R. Van Sickle
2003-10-31 10:00 ` Gerrit P. Haase
2003-10-31 16:22   ` y2bismil
2003-10-31 17:00     ` y2bismil
2003-10-31 18:13       ` gcc and iostream - final issue y2bismil
2003-10-31 18:39         ` Christopher Faylor
2003-10-31 21:07         ` Brian Ford
2003-10-31 21:34           ` y2bismil
2003-10-31 22:05             ` gcc and iostream - resolved y2bismil
2003-10-31 22:48               ` Brian Ford
2003-10-31 22:24             ` gcc and iostream - final issue Brian Ford
2003-10-30 22:41 gcc and iostream Timothy C Prince

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).