![]() |
發(fā)布時間: 2020-11-20 21:37
正文摘要:為什么調(diào)試不出來HEX文件? 錯誤:error C267: 'delayms': requires ANSI-style prototype |
星野科技 發(fā)表于 2020-11-21 18:47 我明白了 |
星野科技 發(fā)表于 2020-11-21 18:46 太關(guān)鍵了,沒注意到,謝謝了 |
LLLSBB1 發(fā)表于 2020-11-21 08:39 #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); } } |
應(yīng)該是void main, 你寫成了 viod main, void寫成了viod |
void main() 你寫的是viod main, 寫錯字母了 |
taotie 發(fā)表于 2020-11-21 14:28 有勾選哦 |
編譯器中沒有勾選HEX文件生成這個選項? |
最咸一條魚 發(fā)表于 2020-11-21 11:02 好的,但是定義了之后好像也出現(xiàn),目標(biāo)未建立的錯誤出現(xiàn) |
LLLSBB1 發(fā)表于 2020-11-21 08:39 見8樓 ![]() ![]() |
主函數(shù)里引用了delayms()這個函數(shù),但你沒有定義這個函數(shù),要增加一個delayms()這個函數(shù) |
你要有這個延時函數(shù)代碼 void delayms(unsigned int ms) { unsigned int a, b; for(a=ms; a>0;a--) for(b=125;b>0;b--); } 放在主函數(shù)前面 |
沒有哦 |
taotie 發(fā)表于 2020-11-20 22:46 什么是地雷函數(shù)源代碼呀? |
47okey 發(fā)表于 2020-11-20 22:53 加了延遲函數(shù) void delay(),也是有有錯誤哦 |
沒有延時函數(shù) |
有中文吧? |
缺少地雷函數(shù)源代碼 |
Powered by 單片機(jī)教程網(wǎng)