Bpp error OF 0.9.8

Hey so I’m pretty new to this, I may be missing something simple. But I’m going through the Mastering Open Frameworks book and I keep running into a problem when I try to call the bits per pixel of an Image.

This is what the code is supposed to look like:

ofImage image;

void testApp::setup(){
image.loadImage( “sunflower.png” );

unsigned char *data = image.getPixels();

int components = image.bpp / 8;

for (int y=0; y<image.height; y++) {
for (int x=0; x<image.width; x++) {

int index = components * (x + image.width * y);
int red = data[ index ];
int green = data[ index + 1 ];
int blue = data[ index + 2 ];

Chapter 4
[ 101 ]
float u = abs(sin( x * 0.1 ) * sin( y * 0.1 ) );

data[ index ] = red * u;

data[ index + 1 ] = (255 - red);

data[ index + 2 ] = (255 - blue);

}
}

image.update();
}
void testApp::draw(){
ofBackground( 255, 255, 255 );
ofSetColor( 255, 255, 255 );
image.draw( 0, 0 ); //Draw image
}

But when I run it I get this error in Visual Studio:

Error (active) member “ofImage_::bpp [with PixelType=unsigned char]” (declared at line 595 of “c:\Users\Mitchell Craft\Documents\Code_stuff\OopenFraameWorkks\of_v0.9.8_vs_release\libs\openFrameworks\graphics\ofImage.h”) is inaccessible

I am also having the same problem when calling image.width and image.height

Does anyone know why this may be happening?

Thanks a bunch
-Mitchell