how should I apply libsndfile library in vscode?

186 Views Asked by At

I needed to use libsndfile library in C, and I am using MinGW compiler in VScode. I have set up the library by copying header files and .lib file in the project's sndfile directory. Then to use the library in my code, I edited my c_cpp_properties.json and tasks.json like the picture, linking its directory and defining its paths. But while linking it, the Warning

"property linker is not allowed"

popped up.

And when I compiled the code including the library, The error

C:\Users\user\Fourier\noteanalyzer.c:6:20: fatal error: sndfile.h: No such file or directory #include<sndfile.h> appeared.

Project directory is

C:\Users\user\Fourier (since I was studying fft and sound processing with this)

Where library header is located is

C:\Users\user\Fourier\sndfile\include\sndfile.h

error-(https://i.stack.imgur.com/cb00y.png)

c_cpp_properties-(https://i.stack.imgur.com/14PEl.png)

tasks-(https://i.stack.imgur.com/0vU23.png)

I have tried removing the linker and only set the path of the library, and it seemed to have no error or red markers, but after I compile It resulted in same error.

I have tried removing all the other files except header files and .lib file, it doesn't seem to resolve the path error.

I have added the system environment variable of the library, no effect.

I wonder if the error"property linker not allowed" causes the problem, but there was not much information on that error I could find.

0

There are 0 best solutions below