My apologies. I am very new to c++ and while the syntax makes sense as I have experience with Python, matlab, etc, using xcode and some of the intricacies elude me.
Specifically I am getting a mach-o linker error x64 and sometimes error architecture i386. I have included some simple source code by citizen chunk according to my post above, and it all has built just fine. To reiterate, it seems that the class and header files are compiling just fine, but the linking of the .o objects is experiencing some errors.
My thoughts are that the namespace is altering the linking, but answers that I have found in other forums and on stack exchange all suggest alternate approaches. Some have suggested that I alter settings in "Link Binary with Libraries", and others suggest that there is a discrepancy amongst defining functions.
What I am receiving is:
Undefined symbols for architecture x86_64:
"chunkware_simple::SimpleLimit::setRelease(double) ", referenced from:
MDLimiter::MDLimiter(IPlugInstanceInfo) in MDLimiter.o
"chunkware_simple::SimpleLimit::setAttack(double)" , referenced from:
MDLimiter::MDLimiter(IPlugInstanceInfo) in MDLimiter.o
"chunkware_simple::SimpleLimit::setThresh(double)" , referenced from:
MDLimiter::MDLimiter(IPlugInstanceInfo) in MDLimiter.o
"chunkware_simple::SimpleLimit::SimpleLimit()" , referenced from:
MDLimiter::MDLimiter(IPlugInstanceInfo) in MDLimiter.o
"vtable for chunkware_simple::SimpleLimit", referenced from:
chunkware_simple::SimpleLimit::~SimpleLimit() in MDLimiter.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)
where my namespace is as follows:
namespace chunkware_simple
{
//-------------------------------------------------------------
SimpleLimit::SimpleLimit()
: threshdB_( 0.0 )
, thresh_( 1.0 )
, peakHold_( 0 )
, peakTimer_( 0 )
, maxPeak_( 1.0 )
, att_( 1.0 )
, rel_( 10.0 )
, env_( 1.0 )
, mask_( BUFFER_SIZE - 1 )
, cur_( 0 )
{
setAttack( 1.0 );
outBuffer_[ 0 ].resize( BUFFER_SIZE, 0.0 );
outBuffer_[ 1 ].resize( BUFFER_SIZE, 0.0 );
}
//-------------------------------------------------------------
void SimpleLimit::setThresh( double dB )
{
threshdB_ = dB;
thresh_ = dB2lin( dB );
}
//-------------------------------------------------------------
void SimpleLimit::setAttack( double ms )
{
unsigned int samp = int( 0.001 * ms * att_.getSampleRate() );
assert( samp < BUFFER_SIZE );
peakHold_ = samp;
att_.setTc( ms );
}
//-------------------------------------------------------------
void SimpleLimit::setRelease( double ms )
{
rel_.setTc( ms );
}
//-------------------------------------------------------------
void SimpleLimit::setSampleRate( double sampleRate )
{
att_.setSampleRate( sampleRate );
rel_.setSampleRate( sampleRate );
}
//-------------------------------------------------------------
void SimpleLimit::initRuntime( void )
{
peakTimer_ = 0;
maxPeak_ = thresh_;
env_ = thresh_;
cur_ = 0;
outBuffer_[ 0 ].assign( BUFFER_SIZE, 0.0 );
outBuffer_[ 1 ].assign( BUFFER_SIZE, 0.0 );
}
//-------------------------------------------------------------
void SimpleLimit::FastEnvelope::setCoef( void )
{
// rises to 99% of in value over duration of time constant
coef_ = pow( 0.01, (1000.0 / (ms_ * sampleRate_) ) );
}
//-------------------------------------------------------------
void SimpleLimit::getLatency( double ms )
{
unsigned int samp = int( 0.001 * ms * att_.getSampleRate() );
assert( samp < BUFFER_SIZE );
peakHold_ = samp;
att_.setTc( ms );
}
|