On 02/07/2016 01:56 PM, Mike Miller wrote:
On Fri, Feb 05, 2016 at 16:38:08 -0700, Orion Poplawski wrote:
I'm afraid I'm not very experience with automake/autoconf so perhaps I've
messed something else up.
$ cat configure.ac
AC_INIT(test, 1.0, or...@nwra.com)
AC_CONFIG_SRCDIR(src/foobar.cpp)
AM_INIT_AUTOMAKE
AC_PROG_CC
gl_EARLY
AC_PROG_CXX
AC_PROG_RANLIB
AC_CONFIG_FILES(lib/Makefile)
AC_OUTPUT(Makefile src/Makefile)
gl_iNIT
Small but important typo, that should be "gl_INIT".
I made a few more adjustments, the following works for me:
AC_INIT(test, 1.0, or...@nwra.com)
AC_CONFIG_SRCDIR(src/foobar.cpp)
AM_INIT_AUTOMAKE(foreign)
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
gl_EARLY
gl_INIT
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_FILES(Makefile lib/Makefile src/Makefile)
AC_OUTPUT
Ah, thank you very much for catching that. Now with a simple:
#include <config.h>
#include <math.h>
#include <cmath>
int main(int argc,char **argv) {
}
I'm able to reproduce the compile error:
g++ -DHAVE_CONFIG_H -I. -I.. -I../lib -g -O2 -MT foobar.o -MD -MP -MF
.deps/foobar.Tpo -c -o foobar.o foobar.cpp
In file included from foobar.cpp:2:0:
../lib/math.h: In function ‘int signbit(float)’:
../lib/math.h:2576:1: error: ‘int signbit(float)’ conflicts with a
previous declaration
_GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
^
In file included from /usr/include/c++/6.0.0/math.h:36:0,
from ../lib/math.h:27,
from foobar.cpp:2:
/usr/include/c++/6.0.0/cmath:681:3: note: previous declaration
‘constexpr bool std::signbit(float)’
signbit(float __x)
^~~~~~~
In file included from foobar.cpp:2:0:
../lib/math.h: In function ‘int signbit(double)’:
../lib/math.h:2576:1: error: ‘int signbit(double)’ conflicts with a
previous declaration
_GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
^
In file included from /usr/include/c++/6.0.0/math.h:36:0,
from ../lib/math.h:27,
from foobar.cpp:2:
/usr/include/c++/6.0.0/cmath:685:3: note: previous declaration
‘constexpr bool std::signbit(double)’
signbit(double __x)
^~~~~~~
In file included from foobar.cpp:2:0:
../lib/math.h: In function ‘int signbit(long double)’:
../lib/math.h:2576:1: error: ‘int signbit(long double)’ conflicts with a
previous declaration
_GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
^
In file included from /usr/include/c++/6.0.0/math.h:36:0,
from ../lib/math.h:27,
from foobar.cpp:2:
/usr/include/c++/6.0.0/cmath:689:3: note: previous declaration
‘constexpr bool std::signbit(long double)’
signbit(long double __x)
^~~~~~~
Although I really don't have any good ideas about how to fix this.
--
Orion Poplawski
Technical Manager 303-415-9701 x222
NWRA, Boulder/CoRA Office FAX: 303-415-9702
3380 Mitchell Lane or...@nwra.com
Boulder, CO 80301 http://www.nwra.com