Eclipse 编译正确,但在 'Problems' View 中显示错误

标签 eclipse compiler-construction linker arduino

控制台输出为:

**** Build of configuration Release for project Timertestnew ****

make all 
Building file: ../main.cpp
Invoking: AVR C++ Compiler
avr-g++ -I"G:\arduino-1.0\hardware\arduino\cores\arduino" -DARDUINO=100 -Wall -Os -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -fno-exceptions -mmcu=atmega328p -DF_CPU=16000000UL -MMD -MP -MF"main.d" -MT"main.d" -c -o "main.o" "../main.cpp"
Finished building: ../main.cpp

Building target: Timertestnew.elf
Invoking: AVR C++ Linker
avr-gcc --cref -s -Os -o"Timertestnew.elf"  ./main.o   -lArduinoCore -lm -Wl,-Map,Timertestnew.map,--cref -L"C:\Users\Akhil\workspace\Timertestnew" -mmcu=atmega328p
Finished building target: Timertestnew.elf

Create Flash image (ihex format)
avr-objcopy -R .eeprom -O ihex Timertestnew.elf  "Timertestnew.hex"
Finished building: Timertestnew.hex

Invoking: Print Size
avr-size --format=avr --mcu=atmega328p Timertestnew.elf
AVR Memory Usage
----------------
Device: atmega328p

Program:     620 bytes (1.9% Full)
(.text + .data + .bootloader)

Data:          9 bytes (0.4% Full)
(.data + .bss + .noinit)


Finished building: sizedummy


**** Build Finished ****

“问题” View 输出为:

Description Resource    Path    Location    Type
Symbol 'EEARH' could not be resolved    main.cpp    /Timertestnew   line 15 Semantic Error

Eclipse IDE 编译正常时是否可能错误地显示此错误? 我该如何解决这个问题?

最佳答案

尝试从问题 View 中删除该问题标记并重建您的项目(整个项目,而不仅仅是增量项目)。如果这解决了问题,那么这只是编译器状态不一致的问题。

但是,如果它不能解决问题,则 Eclipse 编辑器可能使用不同的解析器(用于内容辅助等),而该解析器无法处理编译器可以处理的内容。对于这种情况,我会查看与错误相关的 C/C++ 编辑器首选项,也许它是可以关闭的(但是,我不编写 C/C++ 编程,所以我无法告诉您要查找什么)。

关于Eclipse 编译正确,但在 'Problems' View 中显示错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8831490/

相关文章:

java - 未找到传递项目依赖项

java - 以编程方式从另一个项目获取类

eclipse - Jelastic Eclipse 插件 - 所有 Tomcat 应用程序在部署时重新启动

java - 绘制控制流图

c++ - gcc和turbo C的输出差异

linker - Lua编译链接错误

eclipse - 在 Vim 中重复 Eclipse 中的最后一个命令

compiler-construction - 删除左递归

c - 在 Windows 上使用 GSL(编译、链接等)。分步指南

linux - 交叉编译: can't resolve symbol 'register_printf_function'