help-octave
[Top][All Lists]
Advanced

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

Re: Building 3.8.0 on Mountain Lion 10.8.5


From: John W. Eaton
Subject: Re: Building 3.8.0 on Mountain Lion 10.8.5
Date: Wed, 08 Jan 2014 10:04:29 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9

On 01/08/2014 09:17 AM, watsodw wrote:
Hi all,

I have tried to compile Octave 3.8.0 on Mac Mountain Lion 10.8.5 but have
run into the following problem: I have Macports installed in /opt/macports
and all dependencies for Octave are installed there. I am also using
Macports gcc-4.7.3 to compile. It goes fine until some thing tries to
reference stdio.h from /usr/include instead from /opt/macports. I tried
removing /usr from my path but there are system utils there that are needed.
Also using Xcode 5.0.2. The relevant compile output is the following:

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I/opt/macports/include
-I/opt/macports/include/QtGui -I/opt/macports/include
-I/opt/macports/include/QtNetwork -I/opt/macports/include
-I/opt/macports/include/QtCore -I./qterminal/libqterminal -Isrc -I./src
-I./src/m-editor -I./src/qtinfo -I../liboctave/cruft/misc
-I../liboctave/array -I../liboctave/numeric -I../liboctave/numeric
-I../liboctave/operators -I../liboctave/operators -I../liboctave/system
-I../liboctave/util -I../libinterp -I../libinterp -I../libinterp/parse-tree
-I../libinterp/parse-tree -I../libinterp/corefcn -I../libinterp/corefcn
-I../libinterp/octave-value -I../libgnu -I../libgnu -Wall -W -Wshadow
-Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align
-Wcast-qual -g -O2 -D_THREAD_SAFE -pthread -MT
src/m-editor/src_libgui_src_la-file-editor-tab.lo -MD -MP -MF
src/m-editor/.deps/src_libgui_src_la-file-editor-tab.Tpo -c
src/m-editor/file-editor-tab.cc  -fno-common -DPIC -o
src/m-editor/.libs/src_libgui_src_la-file-editor-tab.o
In file included from ../libgnu/stdio.h:43:0,
                  from ../libgnu/wchar.h:71,
                  from /opt/macports/include/gcc47/c++/cwchar:46,
                  from /opt/macports/include/gcc47/c++/bits/postypes.h:42,
                  from /opt/macports/include/gcc47/c++/bits/char_traits.h:42,
                  from /opt/macports/include/gcc47/c++/string:42,
                  from /opt/macports/include/QtCore/qstring.h:54,
                  from /opt/macports/include/QtCore/qobject.h:48,
                  from /opt/macports/include/Qsci/qscilexeroctave.h:33,
                  from src/m-editor/file-editor-tab.cc:31:
/usr/include/stdio.h:265:7: error: previous declaration of 'char*
gets(char*)' with 'C' linkage
In file included from ../libgnu/wchar.h:71:0,
                  from /opt/macports/include/gcc47/c++/cwchar:46,
                  from /opt/macports/include/gcc47/c++/bits/postypes.h:42,
                  from /opt/macports/include/gcc47/c++/bits/char_traits.h:42,
                  from /opt/macports/include/gcc47/c++/string:42,
                  from /opt/macports/include/QtCore/qstring.h:54,
                  from /opt/macports/include/QtCore/qobject.h:48,
                  from /opt/macports/include/Qsci/qscilexeroctave.h:33,
                  from src/m-editor/file-editor-tab.cc:31:
../libgnu/stdio.h:1034:1: error: conflicts with new declaration with 'C++'
linkage
make[3]: *** [src/m-editor/src_libgui_src_la-file-editor-tab.lo] Error 1


Anyone know how to fix this?

The gnulib header is supposed to include the system stdio.h, so you
don't want to disable that.

This looks like a bug in gnulib.  I think the quick fix is to
eliminate the lines

  /* It is very rare that the developer ever has full control of stdin,
     so any use of gets warrants an unconditional warning; besides, C11
     removed it.  */
  #undef gets
  #if HAVE_RAW_DECL_GETS
  _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
  #endif

from the file libgnu/stdio.in.h.

Octave should not be using gets and this code is present just to warn
anyway.

jwe

--
Follow me on twitter: @theoctaveguy


reply via email to

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