[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-users] plugin compiling error
I'm trying to compile two plugins in one file and get
a linking problem
merely sez Undefined Symbols
each of these compiles fine in a separate target
what am I missing? Can I not build a SimpleUnit and a DtorUnit
in the same file?
paul
p.s. yes, it's as simple as this to build (unoptimized) STK ugens
////////////////////////////////////////////
#include "SC_PlugIn.h"
#include "Mandolin.h"
#include "TubeBell.h"
#include "/Users/paul/stk-4.1.3/include/SKINI.h"
#include "/Users/paul/stk-4.1.3/include/SKINI.tbl"
#include "Stk.h"
static InterfaceTable *ft;
struct StkTubeBell : public Unit
{
TubeBell *tubebell;
};
struct StkMandolin : public Unit
{
Mandolin *mandolin;
};
extern "C"
{
void load(InterfaceTable *inTable);
void StkMandolin_next(StkMandolin *unit, int inNumSamples);
void StkMandolin_Ctor(StkMandolin* unit);
void StkMandolin_Dtor(StkMandolin* unit);
void StkTubeBell_next(StkTubeBell *unit, int inNumSamples);
void StkTubeBell_Ctor(StkTubeBell* unit);
};
//////////////////////////////////////////////////////////////////
void StkMandolin_Ctor(StkMandolin* unit)
{
Stk :: setRawwavePath("/Users/paul/stk-4.1.3/rawwaves");
unit->mandolin = new Mandolin((MY_FLOAT) 80);
unit->mandolin->clear();
unit->mandolin->noteOn(IN0(0) ,1);
SETCALC(StkMandolin_next);
StkMandolin_next(unit, 1);
}
void StkMandolin_next(StkMandolin *unit, int inNumSamples)
{
float *out OUT(0);
for (int i=0; i < inNumSamples; ++i)
{
out[i] = unit->mandolin->tick();
}
}
void StkMandolin_Dtor(StkMandolin* unit)
{
delete unit->mandolin;
}
//////////////////////////////////////////////////////////////////
void StkTubeBell_Ctor(StkTubeBell* unit)
{
unit->tubebell = new TubeBell();
unit->tubebell->clear();
unit->tubebell->noteOn(IN0(0) ,1);
SETCALC(StkTubeBell_next);
StkTubeBell_next(unit, 1);
}
void StkTubeBell_next(StkTubeBell *unit, int inNumSamples)
{
float *out OUT(0);
for (int i=0; i < inNumSamples; ++i)
{
out[i] = unit->tubebell->tick();
}
}
void load(InterfaceTable *inTable)
{
ft = inTable;
DefineDtorUnit(StkMandolin);
DefineSimpleUnit(StkTubeBell);
}