gpt4 book ai didi

c++ - .cpp 错误 : no match for 'operator<' in 'std::cerr < "Converting file \""'

转载 作者:行者123 更新时间:2023-11-30 01:28:51 24 4
gpt4 key购买 nike

我正在尝试执行此代码 nmea2kml.cpp

但我不断收到以下错误。该程序还具有命令行参数 -f path Read file at given path (e.g./some/where/nmea.txt) 我应该更改什么才能运行该程序?由于编译器问题,我收到错误了吗?因为我把 cygwin、MinGW 编译器添加到 eclipse 中搞砸了!!我知道程序是正确的。别人已经用过了,得到了结果。(http://julien.cayzac.name/code/gps/)

错误

g++ -O0 -g3 -Wall -c -fmessage-length=0 -osrc\nmea.o ..\src\nmea.cpp
..\src\nmea.cpp: In function `int main(int, char**)':
..\src\nmea.cpp:195: error: no match for 'operator<' in 'std::cerr < "Converting file \""'
..\src\nmea.cpp:195: note: candidates are: operator<(const char*, const char*) <built-in>
..\src\nmea.cpp:195: note: operator<(void*, void*) <built-in>
..\src\nmea.cpp:336: error: no match for 'operator<' in 'std::cout < "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"'
..\src\nmea.cpp:336: note: candidates are: operator<(const char*, const char*) <built-in>
..\src\nmea.cpp:336: note: operator<(void*, void*) <built-in>
..\src\nmea.cpp:336: error: `std::endl(std::basic_ostream<_CharT, _Traits>&)' cannot appear in a constant-expression
..\src\nmea.cpp:355: error: parse error in template argument list
..\src\nmea.cpp:336: error: `endl<<expression error> >' cannot appear in a constant-expression
..\src\nmea.cpp:406: error: parse error in template argument list
..\src\nmea.cpp:336: error: `endl<<expression error> >' cannot appear in a constant-expression
..\src\nmea.cpp:406: error: parse error in template argument list
..\src\nmea.cpp:336: error: `endl<<expression error> >' cannot appear in a constant-expression
..\src\nmea.cpp:406: error: parse error in template argument list
..\src\nmea.cpp:406: error: expected `;' before '}' token
..\src\nmea.cpp:193: warning: unused variable 'outfile'
Build error occurred, build is stopped

最佳答案

看起来你写了std::cerr < "..." (< 运算符)你打算写 std::cerr << "..." 的地方(<< 运算符)。

关于c++ - .cpp 错误 : no match for 'operator<' in 'std::cerr < "Converting file \""',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6977747/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com