使用自己定义的结构体作为返回值的时候,出现了

。。。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}的更多相关文章

  1. 程设刷题 | 编译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> ...

  2. was not declared in this scope

    “was not declared in this scope”是一个错误信息,在编译的时候会遇到.其含义为标识符在其出现的地方是未被定义的. 出现该错误的时候,会同时把未定义的变量名显示出来.比如如 ...

  3. error: 'LOGE' was not declared in this scope

    移植了下HAL,发现编译出现如下错误 error: 'LOGE' was not declared in this scope 比较了一下android4.1的 system/core/include ...

  4. 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 ...

  5. 【QT】error: 'SIGNAL' was not declared in this scope

    error: 'SIGNAL' was not declared in this scope  未在此范围内声明. connect(ui->Btnshowhello,SIGNAL(clicked ...

  6. 【error】'isnan' was not declared in this scope

    error问题 'isnan' was not declared in this scope isnan在cmath中被取消宏定义: // These are possible macros impo ...

  7. [Error] 'exit' was not declared in this scope的解决方法

    新手刚开始用Linux和c++写程序,可能会出现下面的错误 error: ‘exit’ was not declared in this scope 解决方法是 添加 #include <cst ...

  8. 解决Cygwin编译cocos2dx 遇到的 error: 'UINT64_C' was not declared in this scope 问题

    环境工具:Win10.VS2013.cocos2d-x-2.2.6.Cygwin.ADT 问题来源:写了一个小游戏,VS2013上运行成功,就尝试着打包apk,项目导入到ADT里面,添加了cocos2 ...

  9. 编译是报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 ...

随机推荐

  1. ActiveRecord 的类型初始值设定项引发异常

    最近在研究ActiveRecord网上有很多贴子讲怎么用的.但自己照做就是出错. 最终定位在配置文件出错.应该是ActiveRecord有更新的原因.在国外的网站把配置复制了一份替换.问题解决了.我用 ...

  2. 【转】eclipse修改workspace

    [转]eclipse修改workspace 以下方法选其中一种 1.进入 Window > Preferences > General > Startup and Shutdown ...

  3. 权限验证MVC

    http://www.jb51.net/article/20147.htm  引用 <authentication mode="Forms"><!--权限受到阻碍 ...

  4. MVC+NHibernate笔记

    Nhibernate 要求model实体类对于lazy="true" ,字段属性前需要加 virtual sqlserver2005和oracle10g的hibernate.cfg ...

  5. unreal4特性介绍

    原文地址:   https://www.unrealengine.com/products/unreal-engine-4     unreal enginer介绍 我的UE4学习(一) 你曾想过用连 ...

  6. angular实现表格的分页显示

    最近项目中用到了一个功能,就是表格的分页显示.以前没整过,今天学会了,把它整理一下,下次可以直接用. 实例代码:https://github.com/dreamITGirl/projectStudy ...

  7. IntelliJ IDEA 安装golang 插件

    作者的机器为mac OS 用户首先需要在自己的个人机器上安装好 golang 的环境,详细可以参考  hyperledger fabric 1.0.5 分布式部署 (一)安装 golang 的部分. ...

  8. TensorFlow高层封装:从入门到喷这本书

    目录 TensorFlow高层封装:从入门到喷这本书 0. 写在前面 1. TensorFlow高层封装总览 2. Keras介绍 2.1 Keras基本用法 2.2 Keras高级用法 3. Est ...

  9. 配置vmware的固定ip

    一 .概述 为什么要配置固定IP呀?这个很容易解释啊,因为配置集群要设置固定IP(主结点需要管理子结点,通过固定IP识别机器),因为你访问虚拟机方便(不固定IP访问前还需要先查下虚拟机当前分配IP,比 ...

  10. 《SQL 进阶教程》 case:练习题1-1-2 转换行列——在表头里加入汇总列

    select case when sex = 1 then '男性' else '女性' end as '性别', sum(case when name='哈尔滨' THEN population e ...