octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #51830] gethostname and uname nodename return


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #51830] gethostname and uname nodename return "localhost"
Date: Wed, 30 Aug 2017 13:59:05 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #27, bug #51830 (project octave):

You might be right about 32-bit vs 64-bit, someone should try building each
and compare results with the same mxe-octave state and the same octave
revision.

Here's what your config.log says


configure:61378: checking for gethostname
configure:61378: i686-w64-mingw32-gcc -std=gnu11 -o conftest.exe -g -O2
-pthread -fopenmp
-I/home/johnd/mxe-octave/build-qt4/usr/i686-w64-mingw32/include
-Wl,-rpath-link,/home/johnd/mxe-octave/build-qt4/usr/i686-w64-mingw32/lib
-L/home/johnd/mxe-octave/build-qt4/usr/i686-w64-mingw32/lib
-L/home/johnd/mxe-octave/build-qt4/usr/i686-w64-mingw32/lib conftest.c -lm  
-lgdi32 -lws2_32 -luser32 -lkernel32 -lgdi32 -lws2_32 -luser32 -lkernel32 >&5
/tmp/ccXHZXwc.o: In function `main':
/home/johnd/mxe-octave/build-qt4/tmp-stable-octave/octave-4.2.0/.build/conftest.c:350:
undefined reference to `gethostname'
collect2: error: ld returned 1 exit status
configure:61378: $? = 1
configure:61378: result: no


and here's mine with the same test, only difference is compiling for 64-bit:


configure:61378: checking for gethostname
configure:61378: x86_64-w64-mingw32-gcc -std=gnu11 -o conftest.exe -g -O2
-pthread -fopenmp
-I/home/mike/src/octave/mxe-octave/usr/x86_64-w64-mingw32/include
-Wl,-rpath-link,/home/mike/src/octave/mxe-octave/usr/x86_64-w64-mingw32/lib
-L/home/mike/src/octave/mxe-octave/usr/x86_64-w64-mingw32/lib
-L/home/mike/src/octave/mxe-octave/usr/x86_64-w64-mingw32/qt5/lib conftest.c
-lm   -lgdi32 -lws2_32 -luser32 -lkernel32 -lgdi32 -lws2_32 -luser32
-lkernel32 >&5
configure:61378: $? = 0
configure:61378: result: yes


After the test fails on 32-bit, the followup test then passes:


configure:61386: checking for gethostname in winsock2.h and -lws2_32
configure:61418: i686-w64-mingw32-gcc -std=gnu11 -o conftest.exe -g -O2
-pthread -fopenmp
-I/home/johnd/mxe-octave/build-qt4/usr/i686-w64-mingw32/include
-Wl,-rpath-link,/home/johnd/mxe-octave/build-qt4/usr/i686-w64-mingw32/lib
-L/home/johnd/mxe-octave/build-qt4/usr/i686-w64-mingw32/lib
-L/home/johnd/mxe-octave/build-qt4/usr/i686-w64-mingw32/lib conftest.c -lm  
-lgdi32 -lws2_32 -luser32 -lkernel32 -lgdi32 -lws2_32 -luser32 -lkernel32
-lws2_32 >&5
configure:61418: $? = 0
configure:61426: result: yes


The important difference appears to be that "-lws2_32" is appended to the end
of the list of libraries.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51830>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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