Symbol 'DDRB' could not be resolved [ISSUE RESOLVED] [message #1840751] |
Fri, 23 April 2021 10:12 |
Peter Charles-Jones Messages: 11 Registered: April 2021 |
Junior Member |
|
|
I am a newbie trying to move from Arduino IDE to Eclipse and have just followed an Instructable called 'How to Get Started With Eclipse and AVR' by a guy called Andy. I got stuck for a while with the editor as it's new to me.
I spent ages worrying about why the DDRB register name for example was throwing an editor error about being unable to resolve the symbol even though I had included io.h which stores all this information.
The issue went away as soon as I saved the project for the first time and this is how I reconcile this.
The #include <avr/io.h> statement tells the compiler how to resolve symbols but I haven't run the compiler yet. The text editor also has no clue what these symbols are. I guess when the project is saved, these is some process of look up which checks contents of avr/io.h.
I just thought I'd post this as it might save time for some other newbie.
Here's the 'blinky' code used to prove the issue and resolution (I'm a newbie so apologies if code posts are not allowed or the format is wrong.)
/*
* main.c
*
* Created on: 22 Apr 2021
* Author: Peter
*/
#include <avr/io.h>
int main ( void ){
while (1) { // endless loop
DDRB |= (1<<3);
}
return 0;
}
I also attached a screen shot where you can just make out the error I'm referring to.
|
|
|
Powered by
FUDForum. Page generated in 0.09147 seconds