7

I am trying to enable c++11 for gcc 4.6; I am using autconf and I added following to my configure.ac file

AC_PREREQ(2.61)
AC_INIT(SOLARCORE, 1.0.0, BUG-REPORT-ADDRESS)
AM_INIT_AUTOMAKE([1.10 no-define foreign])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/threading/node.h])
AC_CONFIG_HEADER([config.h])
AC_OUTPUT([Makefile src/threading/Makefile])

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
#AC_LANG_PUSH([C++])
AC_LANG([C++])
AC_GNU_SOURCE
AX_CXX_COMPILE_STDCXX_11(,[mandatory])
CXXFLAGS='-Wall -std=gnu++0x'
AC_TYPE_SIZE_T

AC_OUTPUT

I am getting following error

./configure: line 4949: syntax error near unexpected token ,mandatory' ./configure: line 4949:AX_CXX_COMPILE_STDCXX_11(,mandatory)'

I also tried AX_CXX_COMPILE_STDCXX_11([ext],[mandatory])

I want to enable C++11 so that I can use it. I tried without AX_CXX_COMPILE_STDCXX_11 and with just CXXFLAGS in my Makefile but it is not working. So please help. THanks.

Found the answer: Recent version of AX_CXX_COMPILE_STDCXX_11 doesnt need a argument.

4

1 回答 1

0

Are you sure you have the latest version of the macro? Judging from the history available from the autoconf archive, the original version of the macro only expected one argument, not two. If you've not got the second or third revisions of the test, that might account for your trouble.

于 2013-08-17T02:35:38.780 回答