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

。。。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. SQL SERVER动态列名

    在ms sql server实现动态呈现列的方法很多.下面Insus.NET解决也算是另外一种参考. 如: 准备实现功能的数据: ) NOT NULL PRIMARY KEY) INSERT INTO ...

  2. 痞子衡嵌入式:微处理器CPU性能测试基准(Dhrystone)

    大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家介绍的是微处理器CPU性能测试基准Dhrystone. 在嵌入式系统行业用于评价CPU性能指标的标准主要有三种:Dhrystone.MIPS.C ...

  3. surface shader相关参数,命令

    https://docs.unity3d.com/Manual/SL-SurfaceShaders.html 说明: 注意下surfaceshader相关开关选项,input结构体全部可用参数 goo ...

  4. InnoDB Monitors | SHOW ENGINE INNODB STATUS

    参考 <mysql 5.7手册>,15.17章节 InnoDB监视器提供有关InnoDB内部状态的信息. 这些信息对于性能调优非常有用.其实所谓的监视器,就是 show engine in ...

  5. css中多余文字省略号显示

    项目中很多情况都要求多余的文字要以省略号的形式展示在前端页面上.虽然用的多,但是我也不知道为啥,我始终记不住.所以,通过这种方式,让自己加深一下印象 情况一:单行文字超出规定宽度后,以省略号形式展示 ...

  6. pgbouncer的安装和配置

    tar -zxvf libevent-2.0.21-stable.tar.gzcd libevent-2.0.21-stable/mkdir /home/pg10/libevent./configur ...

  7. MySQL 查询练习记录

    MySQL 查询练习记录 最近在复习mysql,在b站上找了一个感觉还不错的视频,把视频中查询练习相关的内容记录了下来,以便自己日后查阅和复习. 视频连接:https://www.bilibili.c ...

  8. Linux修改war包中文件

    rm -rf /tmp/wiq.warcp /u02/wms_dev/wiq-app/wars/wiq.war /tmpcd /tmp jar xvf wiq.war vim WEB-INF/clas ...

  9. 牛客网Java刷题知识点之什么是内部类、为什么要使用内部类、内部类如何使用外部类的属性和方法、成员内部类、局部内部类、静态内部类、匿名内部类

    不多说,直接上干货! 可以将一个类的定义放在另一个类的定义内部,这就是内部类. 内部类是一个非常有用的特性但又比较难理解使用的特性(鄙人到现在都没有怎么使用过内部类,对内部类也只是略知一二). 内部类 ...

  10. MapReduce错误之Error: java.lang.RuntimeException: java.lang.NoSuchMethodException的解决方法

    今天跑MapReduce项目的时候遇到了这个问题,日志如下所示: // :: DEBUG ipc.ProtobufRpcEngine: Call: getDiagnostics took 19ms E ...