bug {was not declared in this scope}
使用自己定义的结构体作为返回值的时候,出现了
。。。was not declared in this scope
检查了各种头文件,把缓存也都删掉了还是不行。
结果,发现,应该这样用vector<MyClass:: myStruct>
error: ‘particle’ was not declared in this scope
vector<particle> Pfloc::pf_init_particles(particle* particles,unsigned x0,unsigned y0)
^
/home/xy/code/pfloc_ubuntu/src/pfloc.cpp::: error: template argument is invalid
vector<particle> Pfloc::pf_init_particles(particle* particles,unsigned x0,unsigned y0)
^
/home/xy/code/pfloc_ubuntu/src/pfloc.cpp::: error: template argument is invalid
/home/xy/code/pfloc_ubuntu/src/pfloc.cpp::: error: prototype for ‘int Pfloc::pf_init_particles(Pfloc::particle*, unsigned int, unsigned int)’ does not match any in class ‘Pfloc’
vector<particle> Pfloc::pf_init_particles(particle* particles,unsigned x0,unsigned y0)
^
In file included from /home/xy/code/pfloc_ubuntu/src/pfloc.cpp:::
/home/xy/code/pfloc_ubuntu/include/pfloc.h::: error: candidate is: std::vector<Pfloc::particle> Pfloc::pf_init_particles(Pfloc::particle*, unsigned int, unsigned int)
vector<particle> pf_init_particles(particle* p,unsigned x0, unsigned y0);
^
/home/xy/code/pfloc_ubuntu/include/pfloc.h::: error: ‘typedef struct Pfloc::particle Pfloc::particle’ is private
} particle;
^
/home/xy/code/pfloc_ubuntu/src/pfloc.cpp::: error: within this context
vector<particle> Pfloc::pf_init_particles(particle* particles,unsigned x0,unsigned y0)
bug {was not declared in this scope}的更多相关文章
- 程设刷题 | 编译C++文件出现to_string is not a member of std 或者 to_string was not declared in this scope的解决方法
写在前面 原文链接:Enabling string conversion functions in MinGW C++在将整型.浮点型.长整型等数据类型转换为字符串时,可使用<string> ...
- was not declared in this scope
“was not declared in this scope”是一个错误信息,在编译的时候会遇到.其含义为标识符在其出现的地方是未被定义的. 出现该错误的时候,会同时把未定义的变量名显示出来.比如如 ...
- error: 'LOGE' was not declared in this scope
移植了下HAL,发现编译出现如下错误 error: 'LOGE' was not declared in this scope 比较了一下android4.1的 system/core/include ...
- c++ - fcgio.cpp:50: error: 'EOF' was not declared in this scope - Stack Overflow
c++ - fcgio.cpp:50: error: 'EOF' was not declared in this scope - Stack Overflow fcgio.cpp:50: error ...
- 【QT】error: 'SIGNAL' was not declared in this scope
error: 'SIGNAL' was not declared in this scope 未在此范围内声明. connect(ui->Btnshowhello,SIGNAL(clicked ...
- 【error】'isnan' was not declared in this scope
error问题 'isnan' was not declared in this scope isnan在cmath中被取消宏定义: // These are possible macros impo ...
- [Error] 'exit' was not declared in this scope的解决方法
新手刚开始用Linux和c++写程序,可能会出现下面的错误 error: ‘exit’ was not declared in this scope 解决方法是 添加 #include <cst ...
- 解决Cygwin编译cocos2dx 遇到的 error: 'UINT64_C' was not declared in this scope 问题
环境工具:Win10.VS2013.cocos2d-x-2.2.6.Cygwin.ADT 问题来源:写了一个小游戏,VS2013上运行成功,就尝试着打包apk,项目导入到ADT里面,添加了cocos2 ...
- 编译是报error: 'EVNET_COME_TO_FOREGROUND' was not declared in this scope
Compile++ thumb : game_shared <= main.cpp jni/hellocpp/main.cpp: In function 'void Java_org_coco ...
随机推荐
- 四 MySQL数据库表设计
一: 设计表: user: ID, PWD, name, type archiveRecord: referdate, archiveNum, owner, user, ...
- maven 依赖范围
- 项目清理和删除svn信息(转)
svn信息是根据文件夹里面的 .svn 文件夹保存相关配置的,删除此文件夹即可去掉svn信息: linux下: find . -type d -name ".svn"|xargs ...
- 《精通Spring4.X企业应用开发实战》读后感第一章
Rod Johnson在2002年,编写了interface21框架,spring就是基于此.Spring于2004年3月24日发布了1.0 Spring遵循的理念“”好的设计优于具体实现,代码应易于 ...
- Linear Algebra - Determinant(基础)
1. 行列式的定义 一阶行列式: \[ \begin{vmatrix} a_1 \end{vmatrix} = a_1 \] 二阶行列式: \[ \begin{vmatrix} a_{11} & ...
- 洛谷 - P1063 - 能量项链 - 区间dp
https://www.luogu.org/problemnew/show/P1063 这个并不是每次只能从两边扩展的,可以从中间断开. #include<bits/stdc++.h> u ...
- mysql联合查询(UNION)
SECLET USER_NAME FROM USERS UNION [ALL] SECLET GNAME FROM SCORES 可以把多条查询语句所产生的结果纵向连接为一体 ALL关键字可以显示全部 ...
- Java8 中的 Optional
从 Java 8 引入的一个很有趣的特性是 Optional 类.Optional 类主要解决的问题是臭名昭著的空指针异常(NullPointerException) —— 每个 Java 程序员都 ...
- 源码分析(一) 进程cleos的命令解析
EOS版本:4.0 一.进程cleos的作用 cleos,即为client eos.从名字就可以猜出来,它是一个标准的客户端程序,而实际上,它也确实为一个标准的client^_^ 准确地说 ...
- C# 数组之int[]
一.数组分类 数组可以简单分为3类: 1维数组 2维数组 交错数组 二.数组初始化 1.一维数组 int [] A = { 1,2,3,4 } 直接赋值 或者 int [] A = new int [ ...