标题中的C ++结构

时间:2013-11-06 22:52:25

标签: c++

我想在这里创建一个简单的结构:

color.h:

#ifndef COLOR_H_
#define COLOR_H_
struct Color{
    float r,g,b;
};
#endif

tile.cpp

#include "color.h"
 void display(int x, int y, int tile_size, Color col){
   glBegin(GL_POLYGON);
   glColor3f(col.r,col.g,col.b);
   ...
}

但我收到以下错误:

color.h:3:color.h:struct:not found

color.h:4:color.h:float:not found

color.h:5:color.h:语法错误:"}"意想不到

0 个答案:

没有答案