Help needed - compile error with VS

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

Ok,

I have some very simple code in the constructor of my plugin just to try and get libsndfile working.

Here it is:

Code: Select all

SNDFILE* inFile = 0;
SF_INFO info;
char* fileName = new char[256];

strcpy(fileName, "C:\\music.wav");

inFile = sf_open(fileName,0,&info);
sf_close(inFile);
When I compile it, I get this error:

MyPugin error LNK2019: unresolved external symbol _sf_close referenced in function "public: __thiscall MyPlugin::MyPlugin(long (__cdecl*)(struct AEffect *,long,long,long,void *,float))" (??0MyPlugin@@QAE@P6AJPAUAEffect@@JJJPAXM@Z@Z)


Here's the funny thing. If I remove the call to sf_open, there is no error. For example, if the code we're just:

Code: Select all

SNDFILE* inFile = 0;
SF_INFO info;
char* fileName = new char[256];
strcpy(fileName, "C:\\music.wav");
then I don't get a compile error!

Any suggestions?

Post

You probably need to tell the compiler where to find the libsndfile libraries. That is, add the directory where the libsndfile libraries live to the list of directories containing libraries that the compiler is aware of.

L

Post

i figured out all i had to do was add the .lib file to the list of source files in the project itself.

Post Reply

Return to “DSP and Plugin Development”