2013-04-08 82 views
0

当我编译我的程序时,我有这条消息error: storage size of 'start' isn't known。该错误是在这里:'start'的存储大小未知

struct _timeb start, finish; 

我做一个头文件时,我已经把声明和原型

#include <stdio.h> 
#include <stdlib.h> 
#include <sys/timeb.h> 
#include <time.h> 

在我的.c文件,我把

#include "image.h" 
#include <math.h> 
+1

'_timeb'定义在哪里? – 2013-04-08 20:48:29

+0

向我们展示_timeb的声明。 – 2013-04-08 20:48:57

+0

您可以创建一个[简短,自包含,正确的示例](http://sscce.org)? – cdhowie 2013-04-08 20:51:30

回答

3

这通常表明上述结构的描述还没有遇到,所以你正试图创建一个编译器还不知道的类型的变量。可能你缺少一个头文件:

#include <sys/timeb.h> 
+0

你是如何快速获得upvotes的? – 2013-04-08 20:49:42

+0

这只有12个视图,你在几秒钟前回答。 – 2013-04-08 20:50:09

+0

@stardust_让我看看我的神奇“upvote历史”,看看。 – cdhowie 2013-04-08 20:50:41