Welcome to %s forums

BrainModular Users Forum

Login Register

Error LNK2019

Create your own modules in C++
Post Reply
User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 14 Feb 2016, 02:09

Hello,

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

Error LNK2019 unresolved external symbol "public: __thiscall Delay::Delay(int)" (??0Delay@@QAE@H@Z) referenced in function "public: __thiscall filter::filter(void)" (??0filter@@QAE@XZ) allpass C:0Hollyhockpersolivardeveloppement USINESDK HH2 6modules olilab31 allpass filterfilter.obj 1


thank you for your help...:)
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 17 Feb 2016, 14:45

I'm still stuck with this...and I defenitly lack solid knowledge of C++.

is a good soul could send me a working code exemple with a class included ?

Many thanks

Olivar
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests