WinAVR 没有 main.elf 的规则

WinAVR no rule for main.elf

我正在尝试生成要在微控制器上刻录的 .hex 文件。

我正在使用 WinAVR

我用 MFile 为我的 ATmega8 生成了 makefile。这是 makefile

main.c

现在,当我尝试从 Programmer's Notepadmake all 时,它给我错误提示:

> "make.exe" all
      0 [main] sh 4248 sync_with_child: child 7356(0x1D8) died before initialization with status code 0xC0000142
  15529 [main] sh 4248 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable
      0 [main] sh 10220 sync_with_child: child 3336(0x1E4) died before initialization with status code 0xC0000142
   9277 [main] sh 10220 sync_with_child: *** child state waiting for longjmp
/usr/bin/sh: fork: Resource temporarily unavailable

-------- begin --------
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Compiling C: main.c
avr-gcc -c -mmcu=atmega8 -I. -gdwarf-2 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=./main.lst  -std=gnu99 -MMD -MP -MF .dep/main.o.d main.c -o main.o 
main.c:14: fatal error: opening dependency file .dep/main.o.d: No such file or directory
compilation terminated.
make.exe: *** [main.o] Error 1

> Process Exit Code: 2
> Time Taken: 00:02

这里的实际错误是什么,我该怎么办?

而在win10中,我不再使用makefile,我直接从cmd中使用这两个命令

  • avr-gcc -Wall -g -Os -mmcu=atmega8 -o main.bin main.c
  • avr-objcopy -j .text -j .data -O ihex main.bin main.hex 这对我有用