2013-04-08 83 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