Hello, 
I just installed mingw-gcc-4.7.3 on top of my cygwin installation. 

Trying to build a library that needs openssl lib, I get undefined references to 
__errno and __getreent from this library. 
- I understood those variables are from cygwin1.dll, is it correct? 
- does this mean that I should build libcrypto on my own from sources using 
mingw-gcc also ? (and same for any other lib currently available in my cygwin 
installation? 
- or am I missing some option in my build ? 

Note: I get the same lib correctly built with : 
- mingw standalone toolchain, but I'd rather use mingw-gcc in cycgwin if 
possible. 
- cygwin's gcc, but running a JNI lib that uses printf or other stdio stuff 
hangs the VM. 

regards. 

----------------------- 
$ /bin/i686-pc-mingw32-gcc.exe -Wl,--add-stdcall-alias obj/myobj.o 
/lib/libcrypto.a /lib/libz.a /lib/gcc/i686-pc-mingw32/4.7.3/libstdc++.a -shared 
-o libwin/jnat1357.dll -v
Utilisation des specs internes.
COLLECT_GCC=/bin/i686-pc-mingw32-gcc
COLLECT_LTO_WRAPPER=/bin/../lib/gcc/i686-pc-mingw32/4.7.3/lto-wrapper.exe
Target: i686-pc-mingw32
Configuré avec: 
/usr/src/packages/mingw-gcc/32/mingw-gcc-4.7.3-1/src/gcc-4.7.3/configure 
--srcdir=/usr/src/packages/mingw-gcc/32/mingw-gcc-4.7.3-1/src/gcc-4.7.3 
--prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin 
--libexecdir=/usr/lib --datadir=/usr/share --localstatedir=/var 
--sysconfdir=/etc --datarootdir=/usr/share --docdir=/usr/share/doc/mingw-gcc -C 
--build=i686-pc-cygwin --host=i686-pc-cygwin --target=i686-pc-mingw32 
--without-libiconv-prefix --without-libintl-prefix 
--with-sysroot=/usr/i686-pc-mingw32/sys-root 
--with-build-sysroot=/usr/i686-pc-mingw32/sys-root 
--enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions 
--with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry 
--enable-libstdcxx-debug --disable-build-poststage1-with-cxx 
--enable-version-specific-runtime-libs --disable-multilib 
--enable-decimal-float=bid --disable-werror --enable-lto
Modèle de thread: win32
gcc version 4.7.3 (GCC)
LIBRARY_PATH=/bin/../lib/gcc/i686-pc-mingw32/4.7.3/:/bin/../lib/gcc/:/usr/i686-pc-mingw32/sys-root/mingw/lib/
 
COLLECT_GCC_OPTIONS='-shared' '-o' 'mylib.dll' '-v' '-mtune=generic' 
'-march=pentiumpro' 
/bin/../lib/gcc/i686-pc-mingw32/4.7.3/collect2.exe 
--sysroot=/usr/i686-pc-mingw32/sys-root --shared -Bdynamic -e 
_DllMainCRTStartup@12 --enable-auto-image-base -o mylib.dll 
/usr/i686-pc-mingw32/sys-root/mingw/lib/dllcrt2.o 
/bin/../lib/gcc/i686-pc-mingw32/4.7.3/crtbegin.o 
-L/bin/../lib/gcc/i686-pc-mingw32/4.7.3 -L/bin/../lib/gcc 
-L/usr/i686-pc-mingw32/sys-root/mingw/lib --add-stdcall-alias obj/myobj.o 
/lib/libcrypto.a /lib/libz.a /lib/gcc/i686-pc-mingw32/4.7.3/libstdc++.a 
-lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 
-luser32 -lkernel32 -lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex -lmsvcrt 
/bin/../lib/gcc/i686-pc-mingw32/4.7.3/crtend.o 
/lib/libcrypto.a(cryptlib.o):cryptlib.c:(.text+0x211): référence indéfinie vers 
« __errno » 
/lib/libcrypto.a(cryptlib.o):cryptlib.c:(.text+0x559): référence indéfinie vers 
« __getreent » 
/lib/libcrypto.a(cryptlib.o):cryptlib.c:(.text+0xc24): référence indéfinie vers 
« __getreent »

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply via email to