Error 'serial' not declared?


So I have been running a set of simple code to receive a transmitted RF signal via arduino/atmega328 using the NRFL01+ modules and it has been working fine. I was having some simple errors reading the code and thought I had discovered how to solve them when I tried uploading the new code. To my surprise it did not compile (for that matter, nothing with an analog pin definition or serial command will compile anymore and I haven't changed anything. in definitions or libraries. I received plenty of errors like this: " error: 'Serial' was not declared in this scope" and this: " error: 'SPIE' was not declared in this scope" (and a plethora of similar errors). I made sure to check that SPI.h was defined, and tried both restarting the IDE and my computer. No files were changed since it worked until now when it doesn't work, so I am at a loss for what's happening here or how to go about fixing it. Any advice from someone who's seen this problem before would be much appreciated, along with any tips or ideas. Thanks ahead of time!

o I am at a loss for what’s happening here or how to go about fixing it.

Since you didn’t post your code, I can’t imagine how we are going to be able to help you.

when I tried uploading the new code

Can you clarify what this means exactly. What new code? Do you mean upload?

Post the errors that you're getting (copy/paste from the Arduino IDE) as well as your full sketch.

Be sure to put it inside of the [code[ square brackets so that people can see which is the code and which isn't.

Also, read this: Read this before posting a programming question ... - Programming Questions - Arduino Forum

This example will not compile for example (nor with anything) - I meant to clarify that in my original post. Apologies and much thanks. - any ideas?

  Reads an analog input on pin 0, converts it to voltage, and prints the result to the serial monitor.
  Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
 This example code is in the public domain.

// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
  float voltage = sensorValue * (5.0 / 1023.0);
  // print out the value you read:

I have now also ran this on a fresh install of the IDE with no luck either. Kinda stumped

Sure sounds like your IDE file install got hosed somehow.

That's what I thought, It literally worked one second and not the next with the only change being a number in the operating channel in a code I was running. I just put a new instance of the IDE and it still doesn't compile - do I have to delete everything from the old one first? Is there a specific protocol for getting it to work again? Thanks for the reply.

Moved all old instances and files and re-installed, bringing most of my old files back in the new directory it work again. If anyone knows what caused this to happen, being that I didn't "do" anything between the time it worked and didn't it would be much appreciated so I (and hopefully someone else) can avoid future problems like this.