English 中文(简体)
剪辑汇编正确,但发现问题错误
原标题:Eclipse compiles correctly but shows error in Problems view

青春期产出是:

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

make all 
Building file: ../main.cpp
Invoking: AVR C++ Compiler
avr-g++ -I"G:arduino-1.0hardwarearduinocoresarduino" -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:UsersAkhilworkspaceTimertestnew" -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 ****

问题观点认为产出是:

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

Is it possible that eclipse ide is mistakenly showing this error while it compiles it fine? How can I fix this?

最佳回答

想从问题的角度删除这一问题标记,并重建你们的项目(当然,而不仅仅是一个渐进式的项目)。 如果这个问题存在,那只是汇编者的一个不一致状况。

然而,如果它不解决问题,那么Eclipse编辑就可能使用不同的名词(内容协助等),无法处理您的编辑能够做的事情。 就本案而言,我想看一下与错误有关的C/C++编辑的偏好,或许可以错开(不过,我没有C/C++方案,因此我无法告诉你什么。

问题回答

avr-gcc 汇编者使用其-mmcu的指挥线论据,确定IO的头号档案包括(因此,包括EEARH EEPROM高地址登记册正在报告之中)

Eclipse may not be aware of this backdoor preprocessor symbol definition (as it probably is using a different compiler for problem detection). From the console output it looks like the IO header file you need is: avr/iom328p.h which is included when the __AVR_ATmega328P__ preprocessor symbol is defined (see here). If you provide this symbol to Eclipse it should cause its compiler to pick up the correct file and define the relevant registers.





相关问题
In Eclipse, why doesn t "Show In" appear for non-Java files?

If I have a *java file open, I can right click on the source, scroll down to "Show In (Alt-Shift-W)", and select Navigator. If I have an *xml, *jsp, or pretty much anything besides a Java source ...

Eclipse: Hover broken in debug perspective

Since upgrading Eclipse (Galileo build 20090920-1017), hover in debug no longer displays a variable s value. Instead, hover behaves as if I were in normal Java perspective: alt text http://...

Eclipse smart quotes - like in Textmate

Happy Friday — Does anyone know if eclipse has the notion of smart quotes like Textmate. The way it works is to select some words and quote them by simply hitting the " key? I m a newbie here so be ...

Indentation guide for the eclipse editor

Is there a setting or plugin for eclipse that can show indentation guides in the editor? Something like the Codekana plugin for visual studio (not so fancy is also OK). Important that it works with ...

Adding jar from Eclipse plugin runtime tab

I want to add .jar files for plugin from the Runtime tab of manifest file. When I use the Add... button, I can see only sub-directories of the plugin project. So if I want to add same .jar file to ...

How to copy multiple projects into single folder in eclipse

I have two projects, Project1 and Project2. Now i want to copy this projects into eclipse workspace but i want these projects to be in a single folder like below. Eclipse Workspace -> Project -> ...

Java: Finding out what is using all the memory

I have a java application that runs out of memory, but I have no idea which code is allocating the memory. Is there an application with which I can check this? I use Eclipse.

热门标签