gpt4 book ai didi

C++ 错误 : unable to find string literal operator

转载 作者:行者123 更新时间:2023-11-28 05:00:34 27 4
gpt4 key购买 nike

我已经开始使用神经网络,所以我得到了一个 FANN 库 ( http://leenissen.dk/fann/wp/ )。我在编译它时遇到问题,特别是文件

/fann-master/src/fann_io.c

我在第 346 行收到错误:

fann_io.c:346:29: error: unable to find string literal operator ‘operator""type’ with ‘const char [20]’, ‘long unsigned int’ arguments if(fscanf(conf, name"="type"\n", val) != 1) \

我已经查过了,但我仍然不知道如何修复它。这是函数。

#define fann_scanf(type, name, val) \
{ \
if(fscanf(conf, name"="type"\n", val) != 1) \
{ \
fann_error(NULL, FANN_E_CANT_READ_CONFIG, name, configuration_file); \
fann_destroy(ann); \
return NULL; \
} \
}

最佳答案

对我有帮助的解决方案是使用编译器选项

-std=c++03

所以最后我可以通过输入来编译整个项目

g++ main.cpp -std=c++03

关于C++ 错误 : unable to find string literal operator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46134103/

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