【发布时间】:2017-01-22 16:39:17
【问题描述】:
我有一个系统,我一直在使用 automake 用 C++11 编译程序,并且一切正常。
但是,当不同的用户使用相同的 Makefile 时,他们会收到上述错误。
现在,如果他们输入g++ --std=gnu++11 program.cpp,则没有投诉。
我已将其范围缩小到导致问题的一行;但是,我不知道如何解决它。
depbase=`echo no_endl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ g++ -DHAVE_CONFIG_H -I。 -I../.. -g --std=gnu++11 -g -O2 -MT no_endl.o -MD -MP -MF $depbase.Tpo -c -o no_endl.o no_endl.cpp &&\ mv -f $depbase.Tpo $depbase.Po问题在于depbase;但是,我不知道它发生了什么或为什么会出现。
下面是我用来生成 Makefile 的 Automake 文件:
bin_PROGRAMS = no_endl
AM_CXXFLAGS = -g --std=gnu++11
no_endl_SOURCES = no_endl.cpp
我的 g++ 和他们的 g++ 之间的唯一区别是我有一个别名,所以 g++ 变成了 g++ -g。
有用的信息
g++ --version
g++ (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
如果我需要提供任何其他信息,请告诉我。
【问题讨论】:
-
我认为开关中不应该有双破折号,只有一个
-std=...
标签: c++11 gcc makefile automake