静态常量给出错误 - "没有命名类型"

时间:2014-08-05 04:33:41

标签: c++

这是我的代码

static const TextureVertexWithZ gMeshVerticesWithZ[] = {

        FVWITHZ(-1.0f, 1.0f,-2.0f,1.0f,0.0f, -1.0f,0.0f, 1.0f,0.0f),
        FVWITHZ(-1.0f, 1.0f,-1.0f,1.0f,0.0f, -1.0f,0.0f, 1.0f,0.0f),
        FVWITHZ(1.0f, 1.0f,-2.0f,1.0f,0.0f, -1.0f,0.0f, 1.0f,1.0f),
        FVWITHZ(-1.0f, 1.0f,-1.0f,1.0f,0.0f, -1.0f, 0.0f, 0.0f,1.0f),
        FVWITHZ(1.0f, 1.0f,-1.0f,1.0f,0.0f, -1.0f, 0.0f, 0.0f,0.0f),
        FVWITHZ(1.0f, 1.0f,-2.0f,1.0f,0.0f, -1.0f, 0.0f, 1.0f,0.0f),

        FVWITHZ(1.0f, 1.0f,-1.0f,1.0f,1.0f, 0.0f,0.0f, 1.0f,1.0f),
        FVWITHZ(1.0f, -1.0f,-1.0f,1.0f,1.0f, 0.0f,0.0f, 0.0f,1.0f),
        FVWITHZ(1.0f, 1.0f,-2.0f,1.0f,1.0f, 0.0f,0.0f, 1.0f,0.0f),
        FVWITHZ(1.0f, -1.0f,-1.0f,1.0f,1.0f, 0.0f, 0.0f, 1.0f,0.0f),
        FVWITHZ(1.0f, -1.0f,-2.0f,1.0f,1.0f, 0.0f, 0.0f, 0.0f,1.0f),
        FVWITHZ(1.0f, 1.0f,-2.0f,1.0f,1.0f, 0.0f, 0.0f, 0.0f,0.0f),

        FVWITHZ(1.0f, 1.0f,-2.0f,1.0f,0.0f, 0.0f, -1.0f, 0.0f,1.0f),
        FVWITHZ(1.0f, -1.0f,-2.0f,1.0f,0.0f, 0.0f, -1.0f, 1.0f,1.0f),
        FVWITHZ(-1.0f, 1.0f,-2.0f,1.0f,0.0f, 0.0f, -1.0f, 1.0f,0.0f),
        FVWITHZ(1.0f, -1.0f,-2.0f,1.0f,0.0f, 0.0f, -1.0f,0.0f, 1.0f),
        FVWITHZ(-1.0f, -1.0f,-2.0f,1.0f,0.0f, 0.0f, -1.0f,1.0f, 0.0f),
        FVWITHZ(-1.0f,1.0f,-2.0f,1.0f,0.0f, 0.0f, -1.0f,0.0f, 0.0f),

        FVWITHZ(-1.0f, 1.0f,-1.0f,1.0f,0.0f, 0.0f, 1.0f,0.0f, 1.0f),
        FVWITHZ(-1.0f, -1.0f,-1.0f,1.0f,0.0f, 0.0f, 1.0f,0.0f, 0.0f),
        FVWITHZ(1.0f, 1.0f,-1.0f,1.0f,0.0f, 0.0f, 1.0f,1.0f, 1.0f),
        FVWITHZ(-1.0f, -1.0f,-1.0f,1.0f,0.0f, 0.0f, 1.0f, 0.0f,0.0f),
        FVWITHZ(1.0f, -1.0f,-1.0f,1.0f,0.0f, 0.0f, 1.0f, 1.0f,0.0f),
        FVWITHZ(1.0f, 1.0f,-1.0f,1.0f,0.0f, 0.0f, 1.0f, 1.0f,1.0f),

        FVWITHZ(-1.0f, 1.0f,-2.0f,1.0f,1.0f, 0.0f, 0.0f,1.0f, 1.0f),
        FVWITHZ(-1.0f, -1.0f,-2.0f,1.0f,1.0f, 0.0f, 0.0f,0.0f, 1.0f),
        FVWITHZ(-1.0f, 1.0f,-1.0f,1.0f,1.0f, 0.0f, 0.0f,1.0f, 0.0f),
        FVWITHZ(-1.0f, -1.0f,-2.0f,1.0f,1.0f, 0.0f, 0.0f,1.0f, 0.0f),
        FVWITHZ(-1.0f,-1.0f,-1.0f,1.0f,1.0f, 0.0f, 0.0f,0.0f, 1.0f),
        FVWITHZ(-1.0f, 1.0f,-1.0f,1.0f,1.0f, 0.0f, 0.0f,0.0f, 0.0f),

        FVWITHZ(1.0f, -1.0f,-2.0f,1.0f,0.0f, 1.0f, 0.0f, 0.0f,0.0f),
        FVWITHZ(1.0f, -1.0f,-1.0f,1.0f,0.0f, 1.0f, 0.0f, 0.0f,1.0f),
        FVWITHZ(-1.0f, -1.0f,-2.0f,1.0f,0.0f, 1.0f, 0.0f, 1.0f,1.0f),
        FVWITHZ(1.0f, -1.0f,-1.0f,1.0f,0.0f, 1.0f, 0.0f, 0.0f,0.0f),
        FVWITHZ(-1.0f, -1.0f,-1.0f,1.0f,0.0f, 1.0f, 0.0f, 1.0f,0.0f),
        FVWITHZ(-1.0f, -1.0f,-2.0f,1.0f,0.0f, 1.0f, 0.0f, 1.0f,1.0f),

 };

编译时,我收到错误“错误:'TextureVertexWithZ'没有命名类型”

任何帮助将不胜感激

1 个答案:

答案 0 :(得分:3)

很简单,这意味着编译器不知道TextureVertexWithZ是什么。大概你忘了包含声明它的头文件。