First you have to check that your compiler version (32 or 64 bit) matches libsndfile version. I suppose you did it correctly.
I also suppose you correctly added the sndfile.h
to the include path.
You will need two library files actually. I think you forgot the one to compile properly.
Compiling and Linking (.lib
file)
Note that Netbeans 7.0 doesn't accept .lib files and you need to link the .lib file for your project to compile. So, in C:\Program Files\Mega-Nerd\libsndfile\lib
you need to copy libsndfile-1.lib
and rename the .lib
extension to .a
.
Then, in Poject Properties > Build > Linker > Additional Libraries Directories add the path to the \lib
directory. For me it's Program Files/Mega-Nerd/libsndfile/lib
.
A few lines below, you'll have Poject Properties > Build > Linker > Libraries. Specify the location of the library file named libsndfile-1.a
, for me it's C:\Program Files\Mega-Nerd\libsndfile\lib\libsndfile-1.a
.
Now it should at least compile.
Executing (.dll
)
Now, it likely will not execute even if it compiled. That's because the .dll
file is needed to execute the final .exe
. Simply copy the libsndfile-1.dll
file (for me it's in C:\Program Files\Mega-Nerd\libsndfile\bin
) to your project, next to the .exe
file. For me, it's in C:\proj\dist\Debug\Cygwin-Windows\proj.exe
.
Edit: I checked with the today's 8.2 version of NetBeans, and the procedure is exactly the same.