如何指定 Makefile.am 中需要 C++0x?
目前我的项目有以下简单的树:
./Makefile.am
./configure.ac
./README
./src/main.cpp
./src/Makefile.am
./bin
我正在尝试遵循以下教程:
http://www.gnu.org/software/automake/manual/automake.html#Hello-World
如何指示 configure.ac 使用 C++0x 扩展?特别是,如果 main.cpp 文件中的 hello-world 行如下所示:
cout << ([] () {return "Hello, World!";}) () << endl;
发出“make”会导致错误。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用的是 gcc(看起来像您),请参阅 libstdc++ 手册 他们有用于检查 C++ 基本语言功能的 autoconf 示例:
如果您愿意,您可以尝试在其中放入 lambda。然后,有了 HAVE_STDCXX_0X ,您就可以适当地设置 --std=c++0x 。
If you're using gcc (looks like you are) then from the libstdc++ manual they have autoconf examples for checking c++ base language features:
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.