okay i found out : some .cpp files were not present in the "Build Phase/Compile source" panel
now it's working!
i'm relatively new to developping on OS X thus this noob error.
Jeff
Question
I'm getting errors, all : "Undefined Symbols for architecture x86_64".
the simplest class where this error happens is class named Peaking that computes equalizations.
here is my class definition peaking
#ifndef _PEAKING_
#define _PEAKING_
#include "IPlugBase.h"
#include "IGraphics.h"
class Peaking
{
public:
Peaking()
{
a = new double[3];
b = new double[3];
previousx1=0;
previouspreviousx1=0;
}
~Peaking() {}
double* a;
double* b;
void ComputeParams(double G, double fc, double Q, double fs);
double ComputeAudio(double x);
double previouspreviousx1;
double previousx1;
private:
};
#endif
and here is the implementation
#include <math.h>
#include "defines.hpp"
#include "Peaking.h"
void Peaking::ComputeParams(double G, double fc, double Q, double fs)
{
double K = tan((M_PI * fc)/fs);
double V0 = pow(10,(G/20.));
//Invert gain if a cut
if (V0 < 1)
V0 = 1/V0;
double a1, a2, b0, b1, b2;
////////////////////////////
// BOOST
////////////////////////////
double K2 = pow(K,2.);
double divQ = 1/Q;
double z1 = (divQ*K);
double divz2 = 1/(1 + z1 + K2);
double z3 = ((V0*divQ)*K);
double divz4 = 1/(1 + z3 + K2);
if( G > 0 )
{
b0 = (1 + z3 + K2) * divz2;
b1 = (2 * (K2 - 1)) * divz2;
b2 = (1 - z3 + K2) * divz2;
a1 = b1;
a2 = (1 - z1 + K2) * divz2;
}
////////////////////////////
// CUT
////////////////////////////
else
{
b0 = (1 + z1 + K2) * divz4;
b1 = (2 * (K2 - 1)) * divz4;
b2 = (1 - z1 + K2) * divz4;
a1 = b1;
a2 = (1 - z3 + K2) * divz4;
}
a[0] = 1;
a[1] = a1;
a[2] = a2;
b[0] = b0;
b[1] = b1;
b[2] = b2;
}
double Peaking::ComputeAudio(double x)
{
// E:\Programmation\#Audio\#EQ\dfilt_df2.gif
double srg = a[2];
double x1 = x - a[1] * previousx1 - a[2] * previouspreviousx1;
double y = x1 * b[0] + previousx1 * b[1] + previouspreviousx1 * b[2];
previouspreviousx1 = previousx1;
previousx1 = x1;
return y;
}
here is the error list:
Undefined symbols for architecture x86_64: "OnOff::OnOff(IPlugBase*, int, int, int, IBitmap*, IBitmap*, IChannelBlend::EBlendMethod)", referenced from: AutoEQ::AutoEQ(IPlugInstanceInfo) in AutoEQ.o "Peaking::ComputeAudio(double)", referenced from: AutoEQ::traiterLearning(int) in AutoEQ.o AutoEQ::ProcessDoubleReplacing(double**, double**, int) in AutoEQ.o "Peaking::ComputeParams(double, double, double, double)", referenced from: AutoEQ::traiterLearning(int) in AutoEQ.o "FFTOoura::rdft(int, int, double*, int*, double*)", referenced from: AutoEQ::traiterLearning(int) in AutoEQ.o "vtable for ProgressBar", referenced from: ProgressBar::ProgressBar(IPlugBase*, int, int, int, IBitmap, IBitmap, IChannelBlend::EBlendMethod) in AutoEQ.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. "vtable for EQClass", referenced from: EQClass::EQClass(IPlugBase*, int) in AutoEQ.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. "vtable for VUmetre", referenced from: VUmetre::VUmetre(IPlugBase*, int, int, int, IBitmap, IBitmap, IChannelBlend::EBlendMethod) in AutoEQ.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. "vtable for MyButton", referenced from: MyButton::MyButton(IPlugBase*, int, int, int, IBitmap*, IChannelBlend::EBlendMethod) in AutoEQ.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
if I put the core of the function "double Peaking::ComputeAudio(double x)" in the class, one error disappears.
If i put the body of the virtual function "draw" of Vumetre, another error goes away. So i cannot put some main bodies functions in the .cpp file, how come ?
thanks for help
Jeff
Solution
okay i found out : some .cpp files were not present in the "Build Phase/Compile source" panel
now it's working!
i'm relatively new to developping on OS X thus this noob error.
Jeff