This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc and iostream

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 <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&)'


> 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    

Put the libraries to the end of the linkline:
    -mno-cygwin  -g -o$(_Target)
    <files needed to be linked>

And I'm not sure if this works with Cygwin gcc/ld: -LC:\cygwin\lib\mingw


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]