解决 linker command failed with exit code 1 (use -v to see invocation)

一、开发使用环境
1、mac 10.13.6 

2、vscode

二、报错

解决 linker command failed with exit code 1 (use -v to see invocation)
三、解决方式一:直接命令行

g++ 03_namespace的使用.cpp game2.cpp game1.cpp


四、解决方式二:创建makefile文件


1、创建makefile 文件

解决 linker command failed with exit code 1 (use -v to see invocation)

2、清除之前的工作空间

make/make make clean


3、创建新的工作空间

make namespace


4、生成打印输出的结果文件namespace1,执行namespace1脚本

解决 linker command failed with exit code 1 (use -v to see invocation)