This is the mail archive of the mailing list for the Cygwin project. See the Cygwin home page for more information.
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: troubles while building wxWindows/C++ Mingw executables using Cygwin

Chris <> writes:
> Hi,
> I'm trying to build wxWindows/C++ Mingw executables using Cygwin.
> I've followed the instructions given by Mumit Khan :
>  * got egcs-1.1.1-mingw-libs.tar.gz
>  * installed the target libraries in /usr/local/mingw-libs
>  * add -mno-cygwin to gcc -c
>  * add -L/usr/local/mingw-libs to gcc -o
> It works well with the small hello.c program (thanks Mumit, the tutorial
> is clear and well done)

Hi Chris,

There are a (potential) minor pitfalls with both wxWindows makefiles and 
Cygwin -mno-cygwin support that is causing these.

1. /wx/src/msw/textctrl.cpp:71: undefined reference to
   `streambuf::xsputn(char const *, long)' ...

   When compiling C++ applications that use the libio stuff, you'll need
   to have a Mingw compatible _G_config.h. However, Cygwin b20.1 as
   distributed only supplies the _G_config.h for Cygwin and you're getting
   a mismatch.

   For Mingw, the above should be:

       `streambuf::xsputn(char const *, int)' ...
   Thanks for pointing this out. I'll add this to the mingw-libs package
   for egcs-1.1.2. I'm attaching a copy of _G_config.h for i386-mingw32
   that should fix this. Just put it somewhere and point to the place
   with -I so that it picks this one instead of the installed one.

2. /usr/local/mingw-libs/libstdc++.a(iostream.o)(.text+0x18a9): undefined
   reference to `__imp__iob'
   /usr/local/mingw-libs/libstdc++.a(streambuf.o)(.text+0x30c): undefined
   reference to `_errno'

   The linker is picking the math library for Cygwin, not the empty stub
   used for Mingw. If you don't have a Mingw math library, you can create
   one as following:
     $ ar crv libm.a
     $ ranlib libm.a

   and then relink. This should certainly fix _errno problem; I'm hoping
   that it'll take care of the _imp_iob problem as well.

Let me know if this doesn't fix your problem. 

The problems you're running into unfortunately a fact of life when you're
trying to do cross (or pseudo-cross in this case ;-) compilation/linking.
You'll probably have to do a bit more digging to make sure all the right
includes and libraries are picked up instead of using the Cygwin ones.


Want to unsubscribe from this list?
Send a message to