error: 'XXX' does not name a type:
我遇到的情况就是结构体不是一个类型,我的定义:
struct Rectangle
{
float xmin,xmax,ymin,ymax;
};
Rectangle rect;
结果:'Rectangle ' does not name a type:
改为:struct Rectangle rect;
错误:undefined reference to `__glutInitWithExit'
头文件一定要加上:#include<windows.h>
并且放在最开头。
希望对你有帮助。