当我运行在 Linux 中创建的项目时,“std::cout<<...”行中出现错误:
void Assert(bool condition, std::string message)
{
if(!condition)
{
std::cout<<"message"<<message<<std::endl;
int s = 4/0;
}
}
错误信息:
/MainData.cpp:159: error: explicit instantiation of 'std::basic_ostream<_CharT,
_Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const
std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits =
std::char_traits<char>, _Alloc = std::allocator<char>]' but no definition available
包括行:
#include"iostream"
#include"vector"
#include "math.h"
#include"cstdlib"
#include "string"
可能是什么原因?