public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* troubles while building wxWindows/C++ Mingw executables using Cygwin
@ 1999-03-10  1:46 Chris
       [not found] ` < 36E64070.944A6B90@inria.fr >
  1999-03-31 19:45 ` Chris
  0 siblings, 2 replies; 8+ messages in thread
From: Chris @ 1999-03-10  1:46 UTC (permalink / raw)
  To: 'wxwin-developers', cygwin

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)

I'm also using wxWindows 2.0 and i've some troubles while linking some
samples. For example, I want to run the "minimal" sample and I get some
"undefined reference ":
__________________________________________________________________
gcc -c -D_X86_=1 -DWIN32 -D_WIN32 -DWINVER=0x0400 -D__WIN95__
-D__GNUWIN32__ -D__WIN32__ -I/wx/include -I/wx/src/png
-I/wx/include/wx/msw/gnuwin32 -I/wx/src/zlib   -D__EGCS__ -mno-cygwin
-D__WXMSW__ -D__WINDOWS__ -ggdb -D__WXDEBUG__ -Wall   -o minimal.o
minimal.cpp
windres.exe -i minimal.rc -o minimal_resources.o --include-dir
/wx/include --define __WIN32__ --define __WIN95__ --define __GNUWIN32__
gcc -Wl,--subsystem,windows -mwindows -L/usr/local/mingw-libs -L/wx/lib 
-o minimal.exe minimal.o minimal_resources.o /wx/lib/libwx.a -lstdc++
-lgcc -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -lodbc32
-ladvapi32 -loldnames   
/cygnus/CYGWIN~1/H-I586~1/i586-cygwin32/bin/ld: warning: cannot find
entry symbol _WinMainCRTStartup; defaulting to 00401000
/wx/lib/libwx.a(textctrl.o): In function
`wxTextCtrl::GLOBAL_$I$GetClassInfo(void) const':
/wx/src/msw/textctrl.cpp:71: undefined reference to
`streambuf::xsputn(char const *, long)'
/wx/src/msw/textctrl.cpp:71: undefined reference to
`streambuf::xsgetn(char *, long)'
/wx/src/msw/textctrl.cpp:71: undefined reference to
`streambuf::sys_read(char *, long)'
/wx/src/msw/textctrl.cpp:71: undefined reference to
`streambuf::sys_write(char const *, long)'
/usr/local/mingw-libs/libstdc++.a(iostream.o)(.text+0x18a9): undefined
reference to `__imp__iob'
/usr/local/mingw-libs/libstdc++.a(iostream.o)(.text+0x18b7): undefined
reference to `__imp__iob'
/usr/local/mingw-libs/libstdc++.a(streambuf.o)(.text+0x30c): undefined
reference to `_errno'
/usr/local/mingw-libs/libstdc++.a(stdstrbufs.o)(.text+0x2d): undefined
reference to `__imp__iob'
/usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x173): undefined
reference to `_errno'
/usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x1de): undefined
reference to `_errno'
/usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x232): undefined
reference to `_errno'
/usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x343): undefined
reference to `_errno'
/usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x3f6): undefined
reference to `_errno'
/usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x539): more
undefined references to `_errno' follow
/usr/local/mingw-libs/libstdc++.a(floatconv.o)(.text+0x12e7): undefined
reference to `__imp__HUGE_dll'
/usr/local/mingw-libs/libstdc++.a(floatconv.o)(.text+0x145a): undefined
reference to `_errno'
collect2: ld returned 1 exit status
make: *** [minimal.exe] Error 1
__________________________________________________________________
So, my question is :
Am I doing something wrong or should is it impossible to make
cross-compilation with wxWindows tools ?
Thank you

Christine

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

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

* RE: troubles while building wxWindows/C++ Mingw executables usin
       [not found] ` < 36E64070.944A6B90@inria.fr >
@ 1999-03-10  5:17   ` Vadim Zeitlin
       [not found]     ` < XFMail.990310141736.zeitlin@dptmaths.ens-cachan.fr >
  1999-03-31 19:45     ` Vadim Zeitlin
  1999-03-10 11:18   ` troubles while building wxWindows/C++ Mingw executables using Cygwin Mumit Khan
  1 sibling, 2 replies; 8+ messages in thread
From: Vadim Zeitlin @ 1999-03-10  5:17 UTC (permalink / raw)
  To: Chris; +Cc: cygwin, wxwin-developers

 Hello,

On 10-Mar-99 Chris wrote:
> I'm also using wxWindows 2.0 and i've some troubles while linking some
> samples. For example, I want to run the "minimal" sample and I get some
> "undefined reference ":
...
> /wx/lib/libwx.a(textctrl.o): In function
> `wxTextCtrl::GLOBAL_$I$GetClassInfo(void) const':
> /wx/src/msw/textctrl.cpp:71: undefined reference to
> `streambuf::xsputn(char const *, long)'
> /wx/src/msw/textctrl.cpp:71: undefined reference to
> `streambuf::xsgetn(char *, long)'

 this might actually just mean that there are no such functions in
Cygwin's version of C++ iostream library (I do believe they're
standard - at least they're in the standard draft I have here).
  
> /wx/src/msw/textctrl.cpp:71: undefined reference to
> `streambuf::sys_read(char *, long)'
> /wx/src/msw/textctrl.cpp:71: undefined reference to
> `streambuf::sys_write(char const *, long)'

 The same here, except that these symbols don't seem to be standard.

 To work around these errors you might try to define NO_TEXT_WINDOW_STREAM
for wxWindows compilation.

> /usr/local/mingw-libs/libstdc++.a(iostream.o)(.text+0x18a9): undefined
> reference to `__imp__iob'
> /usr/local/mingw-libs/libstdc++.a(iostream.o)(.text+0x18b7): undefined
> reference to `__imp__iob'
> /usr/local/mingw-libs/libstdc++.a(streambuf.o)(.text+0x30c): undefined
> reference to `_errno'
> /usr/local/mingw-libs/libstdc++.a(stdstrbufs.o)(.text+0x2d): undefined
> reference to `__imp__iob'
> /usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x173): undefined
> reference to `_errno'
> /usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x1de): undefined
> reference to `_errno'
> /usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x232): undefined
> reference to `_errno'
> /usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x343): undefined
> reference to `_errno'
> /usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x3f6): undefined
> reference to `_errno'
> /usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x539): more
> undefined references to `_errno' follow
> /usr/local/mingw-libs/libstdc++.a(floatconv.o)(.text+0x12e7): undefined
> reference to `__imp__HUGE_dll'
> /usr/local/mingw-libs/libstdc++.a(floatconv.o)(.text+0x145a): undefined
> reference to `_errno'
> collect2: ld returned 1 exit status
> make: *** [minimal.exe] Error 1

 No idea about these. 

> So, my question is :
> Am I doing something wrong or should is it impossible to make
> cross-compilation with wxWindows tools ?

 There is no reason it shouldn't be possible. It would be interesting
to hear whether you succeed with it finally and what had you to change
to do it.

 Good luck!
VZ

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

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

* Re: troubles while building wxWindows/C++ Mingw executables using Cygwin
       [not found] ` < 36E64070.944A6B90@inria.fr >
  1999-03-10  5:17   ` troubles while building wxWindows/C++ Mingw executables usin Vadim Zeitlin
@ 1999-03-10 11:18   ` Mumit Khan
  1999-03-31 19:45     ` Mumit Khan
  1 sibling, 1 reply; 8+ messages in thread
From: Mumit Khan @ 1999-03-10 11:18 UTC (permalink / raw)
  To: Chris; +Cc: 'wxwin-developers', cygwin

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

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

* RE: troubles while building wxWindows/C++ Mingw executables usin
       [not found]     ` < XFMail.990310141736.zeitlin@dptmaths.ens-cachan.fr >
@ 1999-03-11 16:47       ` Mumit Khan
  1999-03-31 19:45         ` Mumit Khan
  0 siblings, 1 reply; 8+ messages in thread
From: Mumit Khan @ 1999-03-11 16:47 UTC (permalink / raw)
  To: Vadim Zeitlin; +Cc: Chris, cygwin, wxwin-developers

On Wed, 10 Mar 1999, Vadim Zeitlin wrote:

> 
>  There is no reason it shouldn't be possible. It would be interesting
> to hear whether you succeed with it finally and what had you to change
> to do it.
> 

It does work quite well, except for a few gotcha's:
  
  - you need the mingw version of _G_config.h, which is installed when
    you install the C++ runtime library. Unfortunately, my extra
    mingw libraries package for cygwin doesn't have it (oversight).

  - you have to make sure that *every* compile/link command uses the
    -mno-cygwin flag.

    Also, you *must* have mingw version of libm.a ... this is part of
    egcs-1.1.1-mingw-libs.tar.gz that I distribute.

  - need to fix the libraries that wxwin links in by default.
    Specifically, I believe you need to delete -loldnames, which should
    not have been there in the first place.

    I simply used "c++" as the driver (wxwin uses gcc) to avoid specifying
    -lstdc++ explicitly, and also specified the following in
    makeg95.env:
      
      CC = c++ -mno-cygwin
      OPTIONS= -D__EGCS__  -mno-cygwin #-D__MINGW32__
      WINLIBS= -lwinspool -lwinmm -lcomctl32 -lctl3d32 -lodbc32
    
    (note: I may have missed one or two win32 specific import libraries
    in WINLIBS, but most of the samples did build fine using above).

Since it works for me, it should work for others as well, especially given
that the machine I tested this on doesn't have anything different/special.

I hope Christine Pourcelot posts her experience here once she has things 
squared away.

This is of course for building mingw wxwin using Cygwin gcc; for native
Cygwin builds, it all works out of the box.

I will add this info to my howto on using -mno-cygwin ...

Regards,
Mumit



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

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

* troubles while building wxWindows/C++ Mingw executables using Cygwin
  1999-03-10  1:46 troubles while building wxWindows/C++ Mingw executables using Cygwin Chris
       [not found] ` < 36E64070.944A6B90@inria.fr >
@ 1999-03-31 19:45 ` Chris
  1 sibling, 0 replies; 8+ messages in thread
From: Chris @ 1999-03-31 19:45 UTC (permalink / raw)
  To: 'wxwin-developers', cygwin

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)

I'm also using wxWindows 2.0 and i've some troubles while linking some
samples. For example, I want to run the "minimal" sample and I get some
"undefined reference ":
__________________________________________________________________
gcc -c -D_X86_=1 -DWIN32 -D_WIN32 -DWINVER=0x0400 -D__WIN95__
-D__GNUWIN32__ -D__WIN32__ -I/wx/include -I/wx/src/png
-I/wx/include/wx/msw/gnuwin32 -I/wx/src/zlib   -D__EGCS__ -mno-cygwin
-D__WXMSW__ -D__WINDOWS__ -ggdb -D__WXDEBUG__ -Wall   -o minimal.o
minimal.cpp
windres.exe -i minimal.rc -o minimal_resources.o --include-dir
/wx/include --define __WIN32__ --define __WIN95__ --define __GNUWIN32__
gcc -Wl,--subsystem,windows -mwindows -L/usr/local/mingw-libs -L/wx/lib 
-o minimal.exe minimal.o minimal_resources.o /wx/lib/libwx.a -lstdc++
-lgcc -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -lodbc32
-ladvapi32 -loldnames   
/cygnus/CYGWIN~1/H-I586~1/i586-cygwin32/bin/ld: warning: cannot find
entry symbol _WinMainCRTStartup; defaulting to 00401000
/wx/lib/libwx.a(textctrl.o): In function
`wxTextCtrl::GLOBAL_$I$GetClassInfo(void) const':
/wx/src/msw/textctrl.cpp:71: undefined reference to
`streambuf::xsputn(char const *, long)'
/wx/src/msw/textctrl.cpp:71: undefined reference to
`streambuf::xsgetn(char *, long)'
/wx/src/msw/textctrl.cpp:71: undefined reference to
`streambuf::sys_read(char *, long)'
/wx/src/msw/textctrl.cpp:71: undefined reference to
`streambuf::sys_write(char const *, long)'
/usr/local/mingw-libs/libstdc++.a(iostream.o)(.text+0x18a9): undefined
reference to `__imp__iob'
/usr/local/mingw-libs/libstdc++.a(iostream.o)(.text+0x18b7): undefined
reference to `__imp__iob'
/usr/local/mingw-libs/libstdc++.a(streambuf.o)(.text+0x30c): undefined
reference to `_errno'
/usr/local/mingw-libs/libstdc++.a(stdstrbufs.o)(.text+0x2d): undefined
reference to `__imp__iob'
/usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x173): undefined
reference to `_errno'
/usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x1de): undefined
reference to `_errno'
/usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x232): undefined
reference to `_errno'
/usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x343): undefined
reference to `_errno'
/usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x3f6): undefined
reference to `_errno'
/usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x539): more
undefined references to `_errno' follow
/usr/local/mingw-libs/libstdc++.a(floatconv.o)(.text+0x12e7): undefined
reference to `__imp__HUGE_dll'
/usr/local/mingw-libs/libstdc++.a(floatconv.o)(.text+0x145a): undefined
reference to `_errno'
collect2: ld returned 1 exit status
make: *** [minimal.exe] Error 1
__________________________________________________________________
So, my question is :
Am I doing something wrong or should is it impossible to make
cross-compilation with wxWindows tools ?
Thank you

Christine

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


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

* RE: troubles while building wxWindows/C++ Mingw executables usin
  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-31 19:45     ` Vadim Zeitlin
  1 sibling, 0 replies; 8+ messages in thread
From: Vadim Zeitlin @ 1999-03-31 19:45 UTC (permalink / raw)
  To: Chris; +Cc: cygwin, wxwin-developers

 Hello,

On 10-Mar-99 Chris wrote:
> I'm also using wxWindows 2.0 and i've some troubles while linking some
> samples. For example, I want to run the "minimal" sample and I get some
> "undefined reference ":
...
> /wx/lib/libwx.a(textctrl.o): In function
> `wxTextCtrl::GLOBAL_$I$GetClassInfo(void) const':
> /wx/src/msw/textctrl.cpp:71: undefined reference to
> `streambuf::xsputn(char const *, long)'
> /wx/src/msw/textctrl.cpp:71: undefined reference to
> `streambuf::xsgetn(char *, long)'

 this might actually just mean that there are no such functions in
Cygwin's version of C++ iostream library (I do believe they're
standard - at least they're in the standard draft I have here).
  
> /wx/src/msw/textctrl.cpp:71: undefined reference to
> `streambuf::sys_read(char *, long)'
> /wx/src/msw/textctrl.cpp:71: undefined reference to
> `streambuf::sys_write(char const *, long)'

 The same here, except that these symbols don't seem to be standard.

 To work around these errors you might try to define NO_TEXT_WINDOW_STREAM
for wxWindows compilation.

> /usr/local/mingw-libs/libstdc++.a(iostream.o)(.text+0x18a9): undefined
> reference to `__imp__iob'
> /usr/local/mingw-libs/libstdc++.a(iostream.o)(.text+0x18b7): undefined
> reference to `__imp__iob'
> /usr/local/mingw-libs/libstdc++.a(streambuf.o)(.text+0x30c): undefined
> reference to `_errno'
> /usr/local/mingw-libs/libstdc++.a(stdstrbufs.o)(.text+0x2d): undefined
> reference to `__imp__iob'
> /usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x173): undefined
> reference to `_errno'
> /usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x1de): undefined
> reference to `_errno'
> /usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x232): undefined
> reference to `_errno'
> /usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x343): undefined
> reference to `_errno'
> /usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x3f6): undefined
> reference to `_errno'
> /usr/local/mingw-libs/libstdc++.a(fileops.o)(.text+0x539): more
> undefined references to `_errno' follow
> /usr/local/mingw-libs/libstdc++.a(floatconv.o)(.text+0x12e7): undefined
> reference to `__imp__HUGE_dll'
> /usr/local/mingw-libs/libstdc++.a(floatconv.o)(.text+0x145a): undefined
> reference to `_errno'
> collect2: ld returned 1 exit status
> make: *** [minimal.exe] Error 1

 No idea about these. 

> So, my question is :
> Am I doing something wrong or should is it impossible to make
> cross-compilation with wxWindows tools ?

 There is no reason it shouldn't be possible. It would be interesting
to hear whether you succeed with it finally and what had you to change
to do it.

 Good luck!
VZ

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


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

* RE: troubles while building wxWindows/C++ Mingw executables usin
  1999-03-11 16:47       ` Mumit Khan
@ 1999-03-31 19:45         ` Mumit Khan
  0 siblings, 0 replies; 8+ messages in thread
From: Mumit Khan @ 1999-03-31 19:45 UTC (permalink / raw)
  To: Vadim Zeitlin; +Cc: Chris, cygwin, wxwin-developers

On Wed, 10 Mar 1999, Vadim Zeitlin wrote:

> 
>  There is no reason it shouldn't be possible. It would be interesting
> to hear whether you succeed with it finally and what had you to change
> to do it.
> 

It does work quite well, except for a few gotcha's:
  
  - you need the mingw version of _G_config.h, which is installed when
    you install the C++ runtime library. Unfortunately, my extra
    mingw libraries package for cygwin doesn't have it (oversight).

  - you have to make sure that *every* compile/link command uses the
    -mno-cygwin flag.

    Also, you *must* have mingw version of libm.a ... this is part of
    egcs-1.1.1-mingw-libs.tar.gz that I distribute.

  - need to fix the libraries that wxwin links in by default.
    Specifically, I believe you need to delete -loldnames, which should
    not have been there in the first place.

    I simply used "c++" as the driver (wxwin uses gcc) to avoid specifying
    -lstdc++ explicitly, and also specified the following in
    makeg95.env:
      
      CC = c++ -mno-cygwin
      OPTIONS= -D__EGCS__  -mno-cygwin #-D__MINGW32__
      WINLIBS= -lwinspool -lwinmm -lcomctl32 -lctl3d32 -lodbc32
    
    (note: I may have missed one or two win32 specific import libraries
    in WINLIBS, but most of the samples did build fine using above).

Since it works for me, it should work for others as well, especially given
that the machine I tested this on doesn't have anything different/special.

I hope Christine Pourcelot posts her experience here once she has things 
squared away.

This is of course for building mingw wxwin using Cygwin gcc; for native
Cygwin builds, it all works out of the box.

I will add this info to my howto on using -mno-cygwin ...

Regards,
Mumit



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


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

* Re: troubles while building wxWindows/C++ Mingw executables using Cygwin
  1999-03-10 11:18   ` troubles while building wxWindows/C++ Mingw executables using Cygwin Mumit Khan
@ 1999-03-31 19:45     ` Mumit Khan
  0 siblings, 0 replies; 8+ messages in thread
From: Mumit Khan @ 1999-03-31 19:45 UTC (permalink / raw)
  To: Chris; +Cc: 'wxwin-developers', cygwin

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


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

end of thread, other threads:[~1999-03-31 19:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-10  1:46 troubles while building wxWindows/C++ Mingw executables using Cygwin 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   ` troubles while building wxWindows/C++ Mingw executables using Cygwin Mumit Khan
1999-03-31 19:45     ` Mumit Khan
1999-03-31 19:45 ` Chris

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).