Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
228 views
in Technique[技术] by (71.8m points)

c++ - Autotools check for C++11

I use AX_CXX_COMPILE_STDCXX_0X(can look on autoconf-archive) to check for c++11 capabilities of the compiler. It correctly determines that -std=c++0x required, but does not add it to CXXFLAGS. I took a look at the macro source and it actually checks but then restores previous flags.

What should I do to get CXXFLAGS set to be able to compile c++11 source?

Just adding -std=c++0x to AM_CXXFLAGS is not nice solution, because I'd like to put the burden of making the compiler compile in C++11 mode on the autoconf developers, not me.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

What you're looking for has already been made as AX_CXX_COMPILE_STDCXX_11, part of autoconf-archive. It will add the required option to the environment (formerly through CXXFLAGS, now through CXX) and error out if no C++11 support is available.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...