ISO C ++ prohibits declaring a "vector" without type

I am having a problem with arduino c and the StandardCplusplus package. I am trying to declare a vector, but get the following error:

Node.h: 26: error: ISO C ++ prohibits declaring 'vector' without type

Node.h: 26: error: invalid use of '::'

Node.h: 26: error: expected ';' before '<' Marker

If you look at other questions, here or here , people forgot to enable or use std, but I have done both.

/*
 Node.h
*/
#ifndef Node_h
#define Node_h
#include "Arduino.h"
#include <StandardCplusplus.h>
#include <vector>
#include <string>
#include <iterator>
class Node
{
  public:
    Node(int size);
    ~Node();
    float bias();
    void set_bias(float);
    void print();
    void fprint(FILE *);
    float compute(std::vector<float> inputs);
    void setWeights(std::vector<float> inws);
    void set_weight(int,float);
    float dutyCycle();

  protected:
    std::vector<float> _weights;               //input weights:30
    float level;
    void init(int size);
    std::vector<int> firelog;

};

#endif

thanks

edit: I am using the arduino 1.5.5 ide compiler.

edit2: I deleted everything except the vector, according to the comments:

/*
 Node.h
*/
#ifndef Node_h
#define Node_h

#include <vector>
class Node
{
  public:
      Node();
      ~Node();
      std::vector<int> test;
};

#endif

which still throws an error:

In the file included in Node.cpp: 1:

Node.h: 13: : ISO ++ 'vector'

Node.h: 13: : '::'

Node.h: 13: error: expected ';' '<'

+4
3

, StandardCplusplus.h .ini, ++, . , :

/*
 Main.ino (or whatever your main sketch file is called)
*/

#include <StandardCplusplus.h>
#include "Node.h"

// ...

void setup()
{
}

void loop()
{
}

Node.h:

/*
 Node.h
*/
#ifndef Node_h
#define Node_h

#include <vector>
class Node
{
  public:
      Node();
      ~Node();
      std::vector<int> test;
};

#endif
+3

? http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_cplusplus,

++ AVR?

, ++ (, , ). , .cc,.cpp .C, ++. , ++ avr-++.

libstd++, , ++. C++, .

+1

-E , , -c -o. , , , . , , .. , - less.

, Node - ( ). , , std (

, , <vector> . #.*vector, , , :

# 1 "/opt/gcc-current/include/c++/4.9.0/vector" 1 3

std::vector (, - , ). , vector, std::vector .

-, <vector>. vector, . , /opt/gcc-current/include/c++/4.9.0/vector _GLIBCXX_VECTOR , , , .

0
source

Source: https://habr.com/ru/post/1524175/


All Articles