搜索
bottom↓
回复: 2

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

[复制链接]

出0入0汤圆

发表于 2013-3-9 20:33:55 | 显示全部楼层 |阅读模式
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: *** [main.o] 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, 1, 2, 3, s].
#     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 [default] or stabs.
#     AVR Studio 4.10 requires dwarf-2.
#     AVR [Extended] 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
……
……

阿莫论坛20周年了!感谢大家的支持与爱护!!

曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……

出0入0汤圆

 楼主| 发表于 2013-3-9 20:36:12 | 显示全部楼层
有坛有也反应过此类情况,好像跟linux的‘/’和windows下面的‘\’有关系,致文件路径不能正常识别!

出0入0汤圆

发表于 2014-2-25 16:11:43 | 显示全部楼层
楼主:编译出错问题是否解决了啊?
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片。注意:要连续压缩2次才能满足要求!!】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-8-27 01:31

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表