2

私はオブジェクトでベクトルを何百回も使用しましたが、今ではそれらで何もしたくないようです。私はこれからコンパイルエラー「テンプレートタイプパラメータのテンプレート引数はタイプでなければなりません」を受け取り続けます:

私はオープンフレームワークを使用していることに注意してください

#pragma once

#include "ofMain.h"
#include "cLine.h"

using namespace std;

class testApp : public ofBaseApp{
    public:

        vector < cLine > lines; // Here is the vector of type cLine

        void setup();
        void update();
        void draw();

        void keyPressed(int key);
        void keyReleased(int key);
        void mouseMoved(int x, int y);
        void mouseDragged(int x, int y, int button);
        void mousePressed(int x, int y, int button);
        void mouseReleased(int x, int y, int button);
        void windowResized(int w, int h);
        void dragEvent(ofDragInfo dragInfo);
        void gotMessage(ofMessage msg);
};

そして、cLineのヘッダーファイル:

#ifndef aftermotion_cLine_h
#define aftermotion_cLine_h

#include <iostream>
#include "ofMain.h"

class cLine
{
public:

    int y;
    float thickness;

    cLine();
    cLine(const cLine &);
    cLine(float thinkness);

    void draw();
    void update();

};

#endif

編集:私は#includeを試しましたが、それ自体がオープンフレームワークライブラリからの「ofMain.h」ファイルからインクルードされているsdtライブラリの一部であるため、変更はありません。

4

2 に答える 2

3

#include <vector>あなたはあなたのヘッダーに決してありません。そのstd::vectorため、既知のタイプではありません。

于 2012-10-02T00:06:01.067 に答える
-1

vector.h を含める

#include <vector>
于 2012-10-02T00:09:36.420 に答える