-2

我有一个用于上一个程序的简单 Makefile。然而,在这个当前程序中,我使用的是 C++11 功能,并且可以使用 编译我的程序g++47 -std=c++0x test_list.cpp,但是当我在 Makefile 中使用它时,会带来大量错误。

文件:test_list.cpp, List.cpp,List.h

生成文件:

proj2: test_list.o test_list.cpp List.h List.cpp
        g++47 -std=c++0x test_list.cpp -g -Wall -o proj2.x

clean:   
        rm -rf *o proj2

然后我做:make它编译成大量错误。

4

1 回答 1

0

鉴于您提供的信息量,我只能猜测。

proj2: test_list.o test_list.cpp List.h List.cpp 
    g++47 -std=c++0x test_list.cpp -g -Wall -o proj2.x

您是否缺少第二行开头的换行符和制表符?(makefile 对空格敏感)。

为什么不粘贴您看到的错误列表.. 这样更容易提供帮助。

您也没有构建目标文件 test_list.o 的行吗?(即 proj2 目标取决于 test_list.o 并构建它)。

于 2014-02-16T02:55:37.953 回答