yofa2008 发表于 2013-3-9 20:33:55

gcc avr不能正确识别XP下面头文件路径

RT,
命令提示行make报错:

Program:   152 bytes (0.9% Full)
(.text + .data + .bootloader)

Data:          0 bytes (0.0% Full)
(.data + .bss + .noinit)




Compiling C: main.c
avr-gcc -c -mmcu=atmega16a -I. -gdwarf-2 -DF_CPU=8000000UL -Os -funsigned-char -
funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-a
dhlns=./main.lst -IC:\WinAVR-20071221\avr\include -std=gnu99 -Wundef -MMD -MP -M
F .dep/main.o.d main.c -o main.o
In file included from main.c:1:
c:/winavr-20100110/lib/gcc/../../avr/include/avr/iom16a.h:38:4: error: #error "I
nclude <avr/io.h> instead of this file."
In file included from c:/winavr-20100110/lib/gcc/../../avr/include/avr/io.h:238,

               from main.c:2:
c:/winavr-20100110/lib/gcc/../../avr/include/avr/iom16a.h:44:4: error: #error "A
ttempt to include more than one <avr/ioXXX.h> file."
make: *** Error 1

E:\avrtest>

makefile按网友们描述的进行操作,源文件路径也作了更改。依然报错,求解求指点……
makefile文件部分内容:
……
……
# Object files directory
#   To put object files in current directory, use a dot (.), do NOT make
#   this an empty or blank macro!
OBJDIR = .


# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c


# List C++ source files here. (C dependencies are automatically generated.)
CPPSRC =


# List Assembler source files here.
#   Make them always end in a capital .S.Files ending in a lowercase .s
#   will not be considered source files but generated files (assembler
#   output from the compiler), and will be deleted upon "make clean"!
#   Even though the DOS/Win* filesystem matches both .s and .S the same,
#   it will preserve the spelling of the filenames, and gcc itself does
#   care about how the name is spelled on its command-line.
ASRC =


# Optimization level, can be .
#   0 = turn off optimization. s = optimize for size.
#   (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
OPT = s


# Debugging format.
#   Native formats for AVR-GCC's -g are dwarf-2 or stabs.
#   AVR Studio 4.10 requires dwarf-2.
#   AVR COFF format requires stabs, plus an avr-objcopy run.
DEBUG = dwarf-2


# List any extra directories to look for include files here.
#   Each directory must be seperated by a space.
#   Use forward slashes for directory separators.
#   For a directory that has spaces, enclose it in quotes.
EXTRAINCDIRS = C:\WinAVR-20071221\avr\include


# Compiler flag to set the C Standard level.
#   c89   = "ANSI" C
#   gnu89 = c89 plus GCC extensions
#   c99   = ISO C99 standard (not yet fully implemented)
#   gnu99 = c99 plus GCC extensions
CSTANDARD = -std=gnu99
……
……

yofa2008 发表于 2013-3-9 20:36:12

有坛有也反应过此类情况,好像跟linux的‘/’和windows下面的‘\’有关系,致文件路径不能正常识别!{:dizzy:}{:dizzy:}{:dizzy:}

lily2256 发表于 2014-2-25 16:11:43

楼主:编译出错问题是否解决了啊?
页: [1]
查看完整版本: gcc avr不能正确识别XP下面头文件路径