Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6982867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:20:41+00:00 2026-05-27T18:20:41+00:00

Currently my project has the following simple tree: ./Makefile.am ./configure.ac ./README ./src/main.cpp ./src/Makefile.am ./bin

  • 0

Currently my project has the following simple tree:

./Makefile.am
./configure.ac
./README
./src/main.cpp
./src/Makefile.am
./bin

I’m trying to following the following tutorial:

http://www.gnu.org/software/automake/manual/automake.html#Hello-World

How can I instruct configure.ac to use the C++0x extensions? In particular, what if the hello-world line in main.cpp file is as follows:

cout << ([] () {return "Hello, World!";}) () << endl;

Issuing “make” results in an error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:20:41+00:00Added an answer on May 27, 2026 at 6:20 pm

    If you’re using gcc (looks like you are) then from the libstdc++ manual they have autoconf examples for checking c++ base language features:

    # AC_COMPILE_STDCXX_OX
    AC_DEFUN([AC_COMPILE_STDCXX_0X], [
      AC_CACHE_CHECK(if g++ supports C++0x features without additional flags,
      ac_cv_cxx_compile_cxx0x_native,
      [AC_LANG_SAVE
      AC_LANG_CPLUSPLUS
      AC_TRY_COMPILE([
      template <typename T>
        struct check
        {
          static_assert(sizeof(int) <= sizeof(T), "not big enough");
        };
    
        typedef check<check<bool>> right_angle_brackets;
    
        int a;
        decltype(a) b;
    
        typedef check<int> check_type;
        check_type c;
        check_type&& cr = c;],,
      ac_cv_cxx_compile_cxx0x_native=yes, ac_cv_cxx_compile_cxx0x_native=no)
      AC_LANG_RESTORE
      ])
    
      AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x,
      ac_cv_cxx_compile_cxx0x_cxx,
      [AC_LANG_SAVE
      AC_LANG_CPLUSPLUS
      ac_save_CXXFLAGS="$CXXFLAGS"
      CXXFLAGS="$CXXFLAGS -std=c++0x"
      AC_TRY_COMPILE([
      template <typename T>
        struct check
        {
          static_assert(sizeof(int) <= sizeof(T), "not big enough");
        };
    
        typedef check<check<bool>> right_angle_brackets;
    
        int a;
        decltype(a) b;
    
        typedef check<int> check_type;
        check_type c;
        check_type&& cr = c;],,
      ac_cv_cxx_compile_cxx0x_cxx=yes, ac_cv_cxx_compile_cxx0x_cxx=no)
      CXXFLAGS="$ac_save_CXXFLAGS"
      AC_LANG_RESTORE
      ])
    
      AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x,
      ac_cv_cxx_compile_cxx0x_gxx,
      [AC_LANG_SAVE
      AC_LANG_CPLUSPLUS
      ac_save_CXXFLAGS="$CXXFLAGS"
      CXXFLAGS="$CXXFLAGS -std=gnu++0x"
      AC_TRY_COMPILE([
      template <typename T>
        struct check
        {
          static_assert(sizeof(int) <= sizeof(T), "not big enough");
        };
    
        typedef check<check<bool>> right_angle_brackets;
    
        int a;
        decltype(a) b;
    
        typedef check<int> check_type;
        check_type c;
        check_type&& cr = c;],,
      ac_cv_cxx_compile_cxx0x_gxx=yes, ac_cv_cxx_compile_cxx0x_gxx=no)
      CXXFLAGS="$ac_save_CXXFLAGS"
      AC_LANG_RESTORE
      ])
    
      if test "$ac_cv_cxx_compile_cxx0x_native" = yes ||
         test "$ac_cv_cxx_compile_cxx0x_cxx" = yes ||
         test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then
        AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ])
      fi
    ])
    

    You could probably try to put a lambda in there if you wanted. Then with HAVE_STDCXX_0X in hand you could set –std=c++0x appropriately.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project that currently has zero users but we would like
I'm currently working on a project that has scope to become quite large, however
I'm currently working on a project that has a svn repository. I'm used to
I'm currently working on a project that has a sizable amount of both client
I'm currently fixing a JSP project and it currently has a seemingly random collection
I am currently on a short research project. The company I work at has
I'm trying to make a (super) simple software instrument for a new project I'm
I've got a scons build using a simple, common directory setup: project/ SConstruct src/
I'm writing a simple node.js addon in C++ using Eclipse CDT. The project has
I started a new winforms project, fairly simple, has a few labels, text boxes,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.