small medium large xlarge

Back to: All Forums  Arduino
Generic-user-small
15 Aug 2012, 08:45
Ade Oduye (10 posts)

The SensorData class of chapter 5 is not compling. I get the following message with each attempt to run the program:

@The nested type SensorData cannot hide an enclosing type@

I typed the code exactly as found in the book and when that didn’t work, I downloaded the code and replace my code with your SensorData code - same result.

I don’t know how to rectfy this - can you help please?

Maik_schmidt_avatar2_pragsmall
15 Aug 2012, 09:13
Maik Schmidt (122 posts)

You have to compile the code with the Processing IDE. Did you try to compile it with the Arduino IDE perhaps?

Generic-user-small
15 Aug 2012, 10:57
Ade Oduye (10 posts)

Yes, I have been compiling in the Processing IDE

Maik_schmidt_avatar2_pragsmall
15 Aug 2012, 14:38
Maik Schmidt (122 posts)

I have downloaded the code a couple of minutes ago and I’ve compiled it successfully with Processing 1.5.1 on Mac OS X 10.8. I have compiled both InvertedSonar.pde und SensorData.pde.

What exactly did you do?

Generic-user-small
15 Aug 2012, 17:56
Ade Oduye (10 posts)

I think I found what I have been doing wrong.

My InvertedSonar.pde and SensorData.pde files where in a project folder named SensorData. I believe it complained and issued the The nested type SensorData cannot hide an enclosing type message because the SensorData file was embedded in a folder of the same name.

Instead of only copying your code, I copied the entire folder and it worked.

Sorry to have bothered you.

You must be logged in to comment