Closed likui911 closed 7 years ago
d:/Source/CppPrimer/chapter08/ex8_6.cpp:15: undefined reference to read(std::istream&, Sales_data&)' d:/Source/CppPrimer/chapter08/ex8_6.cpp:17: undefined reference toread(std::istream&, Sales_data&)' d:/Source/CppPrimer/chapter08/ex8_6.cpp:19: undefined reference to Sales_data::combine(Sales_data const&)' d:/Source/CppPrimer/chapter08/ex8_6.cpp:21: undefined reference toprint(std::ostream&, Sales_data const&)' d:/Source/CppPrimer/chapter08/ex8_6.cpp:25: undefined reference to `print(std::ostream&, Sales_data const&)'
read(std::istream&, Sales_data&)' d:/Source/CppPrimer/chapter08/ex8_6.cpp:17: undefined reference to
Sales_data::combine(Sales_data const&)' d:/Source/CppPrimer/chapter08/ex8_6.cpp:21: undefined reference to
你有这句吗?
路径文件可都对?
后来查了下,是g++编译的事情,vscode编译脚本没有编译ex7_26.cpp导致的 后来更新了编译脚本就可以了。
d:/Source/CppPrimer/chapter08/ex8_6.cpp:15: undefined reference to
read(std::istream&, Sales_data&)' d:/Source/CppPrimer/chapter08/ex8_6.cpp:17: undefined reference to
read(std::istream&, Sales_data&)' d:/Source/CppPrimer/chapter08/ex8_6.cpp:19: undefined reference toSales_data::combine(Sales_data const&)' d:/Source/CppPrimer/chapter08/ex8_6.cpp:21: undefined reference to
print(std::ostream&, Sales_data const&)' d:/Source/CppPrimer/chapter08/ex8_6.cpp:25: undefined reference to `print(std::ostream&, Sales_data const&)'