C++程序编译出现这种问题是怎么回事?

浏览:11日期:2023-04-27

问题描述

wangxiaoxiaodeMacBook-Air:TextQuery wangxiaoxiao$ g++ -std=c++11 main.cpp TextQuery.cpp QueryResult.cpp Query.cpp Query_base.cpp WordQuery.cpp AndQuery.cpp OrQuery.cpp -o TextQueryUndefined symbols for architecture x86_64: 'operator&(Query const&, Query const&)', referenced from: RunQueries(std::basic_ifstream<char, std::char_traits<char> >&) in ccXxFDh5.o 'operator|(Query const&, Query const&)', referenced from: RunQueries(std::basic_ifstream<char, std::char_traits<char> >&) in ccXxFDh5.old: symbol(s) not found for architecture x86_64collect2: error: ld returned 1 exit status

问题解答

回答1:

操作符未重载

相关文章: