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

。。。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. C#窗体上绘制矩形

    先上效果图 鼠标三个事件 private void Form1_MouseDown(object sender, MouseEventArgs e) { //记录开始点 this.mousedown ...

  2. WPF学习笔记系列之一 (布局详情)

    布局:StackPanel  栈布局:控件不会拐弯且多出的不再显示.DockPanel   停靠布局 吸在上边下边或左右.WrapPanel    环绕布局   一行控件会拐弯Canvas  进行基于 ...

  3. [cf2015ICLFinalsDiv1J]Ceizenpok’s formula

    题意:$C_n^m\% k$ 解题关键:扩展lucas+中国剩余定理裸题 #include<algorithm> #include<iostream> #include< ...

  4. 6、scala面向对象-对象

    一.对象 1.object object,相当于class的单个实例,通常在里面放一些静态的field或者method,第一次调用object的方法时,就会执行object的constructor, ...

  5. JavaScript巩固篇(一)——数据类型与全局变量、局部变量、垃圾回收机制、存储方式、生命周期

    知识要点 数据类型 存储方式 全局变量与局部变量 变量的生命周期 垃圾回收机制 知识概览 数据类型 JavaScript的数据类型分为:基本类型.引用类型 本质区别: 基本数据类型的变量实际值存储在栈 ...

  6. 解决webSocke客户端连接服务端返回400错误

    原因: nginx使用了转发,头信息没设置全,问题出现在nginx的配置文件 解决办法: 修改nginx.conf配置文件,在linux终端敲入vim /etc/nginx/nginx.conf,找到 ...

  7. MySQL注释符号

    今天在执行mysql语句时很奇怪为什么没有执行,查询后发现“-- ”是mysql的注释符号,不会执行的  mysql注释符有三种: 1.#... 2."-- ",注意--后面有一个 ...

  8. Hibernate 继承映射可能会遇到的错误

    问题: 我们在配置hibernate的时候,默认是会配置下面的两个属性的 <property name="hibernate.default_catalog">hibe ...

  9. BZOJ 1123 && Luogu P3469 [POI2008]BLO-Blockade 割点+乘法原理

    想了半天式子...最后在邓大师的帮助下想出此题....QWQ我还是太菜了 对于一个非割点,ans+=2*(n-1); 对于一个割点,ans+= #include<cstdio> #incl ...

  10. 【手撸一个ORM】第三步、SQL语句构造器和SqlParameter封装

    既然是数据库工具,自然少不了增删改查的sql语句,在这里将这些常用SQL拼接操作集成到 [SqlServerBuilder.cs] 当中,方便后面调用. 近几年在项目中一直使用Dapper操作数据库, ...