標(biāo)題: error C267: 'delayms': requires ANSI-style prototype為什么調(diào)試不出來HEX文件。 [打印本頁]

作者: LLLSBB1    時間: 2020-11-20 21:37
標(biāo)題: error C267: 'delayms': requires ANSI-style prototype為什么調(diào)試不出來HEX文件。
為什么調(diào)試不出來HEX文件?
錯誤:error C267: 'delayms': requires ANSI-style prototype

1.jpg (12.19 KB, 下載次數(shù): 135)

1.jpg

2.jpg (13.23 KB, 下載次數(shù): 132)

2.jpg

作者: taotie    時間: 2020-11-20 22:46
缺少地雷函數(shù)源代碼
作者: laopihappy123    時間: 2020-11-20 22:47
有中文吧?
作者: 47okey    時間: 2020-11-20 22:53
沒有延時函數(shù)
作者: LLLSBB1    時間: 2020-11-21 08:39
47okey 發(fā)表于 2020-11-20 22:53
沒有延時函數(shù)

加了延遲函數(shù) void delay(),也是有有錯誤哦
作者: LLLSBB1    時間: 2020-11-21 08:39
taotie 發(fā)表于 2020-11-20 22:46
缺少地雷函數(shù)源代碼

什么是地雷函數(shù)源代碼呀?

作者: LLLSBB1    時間: 2020-11-21 08:40
laopihappy123 發(fā)表于 2020-11-20 22:47
有中文吧?

沒有哦
作者: angmall    時間: 2020-11-21 08:44
你要有這個延時函數(shù)代碼

void delayms(unsigned int ms)                                
{
        unsigned int a, b;                  
        for(a=ms; a>0;a--)         
        for(b=125;b>0;b--);   
}

放在主函數(shù)前面


作者: 最咸一條魚    時間: 2020-11-21 11:02
主函數(shù)里引用了delayms()這個函數(shù),但你沒有定義這個函數(shù),要增加一個delayms()這個函數(shù)
作者: taotie    時間: 2020-11-21 13:11
LLLSBB1 發(fā)表于 2020-11-21 08:39
什么是地雷函數(shù)源代碼呀?

見8樓
作者: LLLSBB1    時間: 2020-11-21 13:40
angmall 發(fā)表于 2020-11-21 08:44
你要有這個延時函數(shù)代碼

void delayms(unsigned int ms)                                

還是有問題

3.jpg (16.52 KB, 下載次數(shù): 132)

3.jpg

4.jpg (9.51 KB, 下載次數(shù): 113)

4.jpg

作者: LLLSBB1    時間: 2020-11-21 13:42
最咸一條魚 發(fā)表于 2020-11-21 11:02
主函數(shù)里引用了delayms()這個函數(shù),但你沒有定義這個函數(shù),要增加一個delayms()這個函數(shù)

好的,但是定義了之后好像也出現(xiàn),目標(biāo)未建立的錯誤出現(xiàn)
作者: taotie    時間: 2020-11-21 14:28
編譯器中沒有勾選HEX文件生成這個選項?
作者: LLLSBB1    時間: 2020-11-21 14:39
taotie 發(fā)表于 2020-11-21 14:28
編譯器中沒有勾選HEX文件生成這個選項?

有勾選哦
作者: 星野科技    時間: 2020-11-21 18:46
void main()
你寫的是viod main, 寫錯字母了
作者: 星野科技    時間: 2020-11-21 18:47
LLLSBB1 發(fā)表于 2020-11-21 13:40
還是有問題

應(yīng)該是void main,  你寫成了 viod main,  void寫成了viod
作者: wulin    時間: 2020-11-21 18:57
LLLSBB1 發(fā)表于 2020-11-21 08:39
什么是地雷函數(shù)源代碼呀?

#include<reg51.h>

void delayms(unsigned int k)//這就是地雷函數(shù)源代碼^_^ ^_^ ^_^
{
        unsigned int i,j;
        for(i=k;i>0;i--)
                for(j=120;j>0;j--);
}

void main()
{   
        P0=0xfe;
    while(1)
    {
                delayms(1000);
                P0=(P0<<1)|(P0>>7);
    }      
}

作者: LLLSBB1    時間: 2020-11-21 20:30
星野科技 發(fā)表于 2020-11-21 18:46
void main()
你寫的是viod main, 寫錯字母了

太關(guān)鍵了,沒注意到,謝謝了
作者: LLLSBB1    時間: 2020-11-21 20:31
星野科技 發(fā)表于 2020-11-21 18:47
應(yīng)該是void main,  你寫成了 viod main,  void寫成了viod

我明白了




歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1