1 Replies - 2069 Views - Last Post: 23 December 2011 - 11:25 AM

#1 mattiejd  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 26
  • Joined: 28-January 10

error: 'fftSize' was not declared in this scope

Posted 23 December 2011 - 08:38 AM

Hello, I have a class with an integer variable
 int fftSize = 2048; 
which I want to use in a function. Here's what I've got...

class myFFT
{
public:
myFFT (int size = 2048)
{
int fftSize = size;
int fftSizeO2 = fftSize/2;
int log2n = log2f(fftSize);
float log2n02 = log2n/2;

in_real = (float *) malloc(fftSize * sizeof(float));

// nb: this isn't all of the code in this section, but the other stuff is irrelevant
}

void FFT (float *buffer, )
{
cblas_scopy(fftSize, buffer, 1, in_real, 1); // cblas_scopy is a function from Apple's vDSP Accelerate Framework
// etc
}

private:
//again there's stuff in here that isn't specific to this problem
};



I am getting the error that 'fftSize' was not declared in this scope (in the void function)... not sure why as it's in the public section!
It's probably a silly error, but I've been scratching my head over it all day. Any help, greatly appreciated - thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: error: 'fftSize' was not declared in this scope

#2 mattiejd  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 26
  • Joined: 28-January 10

Re: error: 'fftSize' was not declared in this scope

Posted 23 December 2011 - 11:25 AM

Nevermind, I've managed to sort it out by declaring those variables as a size_t in the private section of the FFT class.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1