public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Mumit Khan <khan@xraylith.wisc.EDU>
To: Chris <Christine.Pourcelot@inria.fr>
Cc: "'wxwin-developers'"
	<wxwin-developers@wx.dent.med.uni-muenchen.de>,
	cygwin <cygwin@sourceware.cygnus.com>
Subject: Re: troubles while building wxWindows/C++ Mingw executables using Cygwin
Date: Wed, 10 Mar 1999 11:18:00 -0000	[thread overview]
Message-ID: <199903101914.NAA26447@modi.xraylith.wisc.edu> (raw)
In-Reply-To: Your message of "Wed, 10 Mar 1999 10:50:40 +0100."            < 36E64070.944A6B90@inria.fr >

Chris <Christine.Pourcelot@inria.fr> 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.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

WARNING: multiple messages have this Message-ID
From: Mumit Khan <khan@xraylith.wisc.EDU>
To: Chris <Christine.Pourcelot@inria.fr>
Cc: "'wxwin-developers'"
	<wxwin-developers@wx.dent.med.uni-muenchen.de>,
	cygwin <cygwin@sourceware.cygnus.com>
Subject: Re: troubles while building wxWindows/C++ Mingw executables using Cygwin
Date: Wed, 31 Mar 1999 19:45:00 -0000	[thread overview]
Message-ID: <199903101914.NAA26447@modi.xraylith.wisc.edu> (raw)
Message-ID: <19990331194500.nPVD2Q7U_4KAF_Bf759diqL8qhhW4ZVwui-z1WWkgS0@z> (raw)
In-Reply-To: <36E64070.944A6B90@inria.fr>

Chris <Christine.Pourcelot@inria.fr> 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.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


  parent reply	other threads:[~1999-03-10 11:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-10  1:46 Chris
     [not found] ` < 36E64070.944A6B90@inria.fr >
1999-03-10  5:17   ` troubles while building wxWindows/C++ Mingw executables usin Vadim Zeitlin
     [not found]     ` < XFMail.990310141736.zeitlin@dptmaths.ens-cachan.fr >
1999-03-11 16:47       ` Mumit Khan
1999-03-31 19:45         ` Mumit Khan
1999-03-31 19:45     ` Vadim Zeitlin
1999-03-10 11:18   ` Mumit Khan [this message]
1999-03-31 19:45     ` troubles while building wxWindows/C++ Mingw executables using Cygwin Mumit Khan
1999-03-31 19:45 ` Chris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199903101914.NAA26447@modi.xraylith.wisc.edu \
    --to=khan@xraylith.wisc.edu \
    --cc=Christine.Pourcelot@inria.fr \
    --cc=cygwin@sourceware.cygnus.com \
    --cc=wxwin-developers@wx.dent.med.uni-muenchen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).