(1)
g++ -o a.o -c a.cpp 命令可编译通过.并且结果正确. 注意-c 单独编译类
g++ -o test test.cpp a.cpp test为主程序
或者直接
(2)g++ -o test test.cpp a.cpp
(1)
g++ -o a.o -c a.cpp 命令可编译通过.并且结果正确. 注意-c 单独编译类
g++ -o test test.cpp a.cpp test为主程序
或者直接
(2)g++ -o test test.cpp a.cpp