不能在Netbeans IDE 7.2中包含队列/堆栈C++STL类

Cant include queue/stack C++ STL classes in Netbeans IDE 7.2

本文关键字:队列 堆栈 C++STL 包含 Netbeans IDE 不能      更新时间:2023-10-16

我在C++中使用Netbeans 7.2 IDE实现音乐项目,该项目涉及处理声音信息。我想使用STL队列和堆栈类来处理和弦结构。我的问题是IDE无法识别std::queue或std::stack类,并且在它们旁边出现了可怕的红色感叹号。如果没有这些课,我看不出我怎么能取得更大的进步。这是我的密码。提前谢谢。。

#ifndef CHORD_H
#define CHORD_H
#include "../tonestatdynlib/name_pitchstructure.h"

class chord {
public:
    chord(int chordNum);
    chord (int chordNum, bool stability);
    chord(const chord& orig); //copy constructor for use in generative procedure
    std::queue<pitchStats> _constituents;
    std::string flatPitchList(); //returns a flat pitchname list from chord members
    virtual ~chord();
private:
    int _chordNumber;
    bool _stable;//unless switched otherwise
  };
#endif /* CHORD_H */

您需要

 #include<queue>
 #include<stack>

能够使用std::queue和std::stack

#include <stack>
#include <queue>

您需要包含这些类的头。

#include <queue>
#include <stack>