mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Where is -lsocket?


From: dE
Subject: Re: [Mingw-cross-env-list] Where is -lsocket?
Date: Mon, 16 Feb 2015 13:40:58 +0530
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 02/16/15 02:35, Nagaev Boris wrote:
On Sun, Feb 15, 2015 at 3:33 PM, dE <address@hidden> wrote:
Hi!

I was trying to compile adns on mingw32 build on Linux when I came across
the following --

AR="/home/de/mxe/usr/bin/i686-pc-mingw32-ar"
RANLIB="/home/de/mxe/usr/bin/i686-pc-mingw32-ranlib"
CC="/home/de/mxe/usr/bin/i686-pc-mingw32-gcc-4.8.1" ./configure --host
mingw32
checking whether you requested dynamic linking... yes, by default
checking for mingw32-gcc... /home/de/mxe/usr/bin/i686-pc-mingw32-gcc-4.8.1
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/de/mxe/usr/bin/i686-pc-mingw32-gcc-4.8.1 accepts
-g... yes
checking for /home/de/mxe/usr/bin/i686-pc-mingw32-gcc-4.8.1 option to accept
ISO C89... none needed
checking how to run the C preprocessor...
/home/de/mxe/usr/bin/i686-pc-mingw32-gcc-4.8.1 -E
checking for mingw32-ranlib... /home/de/mxe/usr/bin/i686-pc-mingw32-ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking for poll... no
checking for socket... no
checking for socket in -lsocket... no
configure: error: cannot find library function socket

Thanks for any help!

Try to replace "--host mingw32" with "--host i686-pc-mingw32". Follow
tutorial steps 4 and 5a http://mxe.cc/#tutorial


Best regards,
Boris Nagaev

PATH="/home/de/mxe/usr/bin:$PATH" ./configure --host i686-pc-mingw32 --disable-dynamic --enable-static
configure: WARNING: unrecognized options: --enable-static
checking whether you requested dynamic linking... no
checking for i686-pc-mingw32-gcc... i686-pc-mingw32-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether i686-pc-mingw32-gcc accepts -g... yes
checking for i686-pc-mingw32-gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... i686-pc-mingw32-gcc -E
checking for i686-pc-mingw32-ranlib... i686-pc-mingw32-ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking for poll... no
checking for socket... no
checking for socket in -lsocket... no
configure: error: cannot find library function socket

Corresponding parts of configure

 ac_fn_c_check_func "$LINENO" "socket" "ac_cv_func_socket"
if test "x$ac_cv_func_socket" = xyes; then :

else

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
$as_echo_n "checking for socket in -lsocket... " >&6; }
if ${ac_cv_lib_socket_socket+:} false; then :
  $as_echo_n "(cached) " >&6
else
  ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket  $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h.  */

/* Override any GCC internal prototype to avoid an error.
   Use char because int might match the return type of a GCC
   builtin and then its argument prototype would still apply.  */
#ifdef __cplusplus
extern "C"
#endif
char socket ();
int
main ()
{
return socket ();
  ;
  return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
  ac_cv_lib_socket_socket=yes
else
  ac_cv_lib_socket_socket=no
fi
rm -f core conftest.err conftest.$ac_objext \
    conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
$as_echo "$ac_cv_lib_socket_socket" >&6; }
if test "x$ac_cv_lib_socket_socket" = xyes; then :
  cat >>confdefs.h <<_ACEOF
#define HAVE_LIBSOCKET 1
_ACEOF

  LIBS="-lsocket $LIBS"

else

    as_fn_error $? "cannot find library function socket" "$LINENO" 5

fi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]