ArrayArray BrainModular BrainModular Users Forum 2016-02-17T15:45:21+02:00 https://www.brainmodular.org/forums/app.php/feed/topic/5310 2016-02-17T15:45:21+02:00 2016-02-17T15:45:21+02:00 https://www.brainmodular.org/forums/viewtopic.php?t=5310&p=34757#p34757 <![CDATA[Error LNK2019]]>
is a good soul could send me a working code exemple with a class included ?

Many thanks

Olivar

Statistics: Posted by oli_lab — 17 Feb 2016, 14:45


]]>
2016-02-14T03:09:50+02:00 2016-02-14T03:09:50+02:00 https://www.brainmodular.org/forums/viewtopic.php?t=5310&p=34729#p34729 <![CDATA[Error LNK2019]]>
to go a bit further into the SDK stuff, I'm trying to make use of classes that are on some different .h and .cpp files

the main files :
filter.h
filter.cpp

the externals :
delay.h
delay.cpp

all the files are inside the same folder.

so, on filter.h

#include "delay.h"
...
// parameters events
Delay*m_delay1;

on filter.cpp

// constructor
filter::filter()
{
const int length = 480;
m_delay1 = new Delay (length);
}

// destructor
filter::~filter()
{
delete m_delay1;
}

on delay.h
// Audio delay class
class Delay
{

public:

// Constructor
Delay(
int size// Size of delay (expressed in samples)
);

//Destructor
~Delay();


and on delay.cpp :

#include "delay.h"

//---------------------------------------------------------------------------------------
// Delay

// Constructor
Delay::Delay(
int size// Size of delay (expressed in samples)
)
{
//Initialize values
m_size = size;
m_read = 0;
m_write = size - 1;

//Ensure that initial sample values at buffer are 0.0f
m_buffer = new float[m_size];
for (int i = 0; i<size; i++)
{
m_buffer = 0.0f;
}
}

//Destructor
Delay::~Delay()
{
delete[] m_buffer;
}

and I get this error as soon as I add "m_delay1 = new Delay (length);" in filter.cpp

ErrorLNK2019unresolved external symbol "public: __thiscall Delay::Delay(int)" (??0Delay@@QAE@H@Z) referenced in function "public: __thiscall filter::filter(void)" (??0filter@@QAE@XZ)allpassC:0Hollyhockpersolivardeveloppement USINESDK HH2 6modules olilab31 allpass filterfilter.obj1


thank you for your help...:)

Statistics: Posted by oli_lab — 14 Feb 2016, 02:09


]]>
BrainModular BrainModular Users Forum 2016-02-17T15:45:21+02:00 https://www.brainmodular.org/forums/app.php/feed/topic/5310 2016-02-17T15:45:21+02:00 2016-02-17T15:45:21+02:00 https://www.brainmodular.org/forums/viewtopic.php?t=5310&p=34757#p34757 <![CDATA[Error LNK2019]]>
is a good soul could send me a working code exemple with a class included ?

Many thanks

Olivar

Statistics: Posted by oli_lab — 17 Feb 2016, 14:45


]]>
2016-02-14T03:09:50+02:00 2016-02-14T03:09:50+02:00 https://www.brainmodular.org/forums/viewtopic.php?t=5310&p=34729#p34729 <![CDATA[Error LNK2019]]>
to go a bit further into the SDK stuff, I'm trying to make use of classes that are on some different .h and .cpp files

the main files :
filter.h
filter.cpp

the externals :
delay.h
delay.cpp

all the files are inside the same folder.

so, on filter.h

#include "delay.h"
...
// parameters events
Delay*m_delay1;

on filter.cpp

// constructor
filter::filter()
{
const int length = 480;
m_delay1 = new Delay (length);
}

// destructor
filter::~filter()
{
delete m_delay1;
}

on delay.h
// Audio delay class
class Delay
{

public:

// Constructor
Delay(
int size// Size of delay (expressed in samples)
);

//Destructor
~Delay();


and on delay.cpp :

#include "delay.h"

//---------------------------------------------------------------------------------------
// Delay

// Constructor
Delay::Delay(
int size// Size of delay (expressed in samples)
)
{
//Initialize values
m_size = size;
m_read = 0;
m_write = size - 1;

//Ensure that initial sample values at buffer are 0.0f
m_buffer = new float[m_size];
for (int i = 0; i<size; i++)
{
m_buffer = 0.0f;
}
}

//Destructor
Delay::~Delay()
{
delete[] m_buffer;
}

and I get this error as soon as I add "m_delay1 = new Delay (length);" in filter.cpp

ErrorLNK2019unresolved external symbol "public: __thiscall Delay::Delay(int)" (??0Delay@@QAE@H@Z) referenced in function "public: __thiscall filter::filter(void)" (??0filter@@QAE@XZ)allpassC:0Hollyhockpersolivardeveloppement USINESDK HH2 6modules olilab31 allpass filterfilter.obj1


thank you for your help...:)

Statistics: Posted by oli_lab — 14 Feb 2016, 02:09


]]>