This is the mail archive of the cygwin@sources.redhat.com 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]

Re: mingw linking problem


Daniel Lidström wrote:
> 
> Hi,
> 
> I get the following error message when compiling. Why can't the linker find
> write?
> /Daniel
> 
> $ make
> g++ -Wall -s -O2 -mno-cygwin -I/usr/local/mingw/include -c broar.cc -o
> broar.o
> g++ broar.o -o broar -s -O2 -mno-cygwin -I/usr/local/mingw/lib -lm

                                          ^^Shouldn't this be -L?

> broar.o(.text+0x90f):broar.cc: undefined reference to `istream::read(char *,
> int
> )'
> broar.o(.text+0xd19):broar.cc: undefined reference to `ostream::write(char
> const
>  *, int)'
> collect2: ld returned 1 exit status
> make: *** [broar.exe] Error 1
> 

You need the MinGW specific libstdc++.a library.  If you have that in
/usr/local/mingw/lib then instead of -I/usr/local/mingw/lib you need to
use -L/usr/local/mingw/lib.

Cheers,
Earnie.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


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