I get the following error when compiling gcc on Windows7-64 under cygwin.
./../zlib/libz.a(libz_a-gzlib.o):gzlib.c:(.text+0x646): undefined reference to `_wopen'
./../zlib/libz.a(libz_a-gzlib.o):gzlib.c:(.text+0x646): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_wopen'
collect2: error: ld returned 1 exit status
make[3]: *** [../.././gcc/fortran/Make-lang.in:97: f951.exe] Error 1
What is wopen?
This doesn't happen with gcc-6, or with gcc-5.
Thank you.
The MSYS2 and CYGWIN can be used with different operation modes: You can use them together with MinGW to build Windows-native software. You can use them together with any other compiler to build Windows-native software, even with Visual Studio.
For source code , that uses the posix api , the cygwin-gcc compiler can be used , it provides a substantial implementation of the posix api , provided by the cygwin1. dll library . cygwin-gcc , can also be used to compile source code , which uses the windows api . In both cases , the cygwin1.
This isn't a problem with building gcc so much, as with building zlib, of which gcc includes a vendored copy.
You may not need to build the vendored zlib if you have the zlib-devel
package installed in your Cygwin. You may also need to tweak some flags to gcc's ./configure
but admittedly I have not taken a close look.
That said, to build zlib on Cygwin the following patches are needed: https://github.com/Alexpux/MSYS2-packages/raw/master/zlib/1.2.11-cygwin-no-widechar.patch
https://github.com/Alexpux/MSYS2-packages/blob/master/zlib/1.2.7-zlib-symbols.patch
(Though the latter doesn't apply cleanly to 1.2.11.) This is because of an attempt to make gzopen_w
work on Cygwin that isn't quite correct, since Cygwin doesn't have _wopen
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With