I'd like to develop code using .wav format and for that reason I need libsndfile1. I installed this using sudo apt-get install libsndfile1-dev, I included header in my program. I'm trying to compile it with this command: g++ -g -Wall -std=c++17 -lsndfile(...)
. Do you know why I can't compile it?
g++ -g -Wall -std=c++17 -lsndfile -o AudioEntropy obj/main.o obj/AudioEntropy.o
obj/AudioEntropy.o: In function `SndfileHandle::SNDFILE_ref::~SNDFILE_ref()':
/usr/local/include/sndfile.hh:163: undefined reference to `sf_close'
obj/AudioEntropy.o: In function `SndfileHandle::SndfileHandle(char const*, int, int, int, int)':
/usr/local/include/sndfile.hh:181: undefined reference to `sf_open'
obj/AudioEntropy.o: In function `SndfileHandle::read(short*, long)':
/usr/local/include/sndfile.hh:332: undefined reference to `sf_read_short'
obj/AudioEntropy.o: In function `SndfileHandle::write(short const*, long)':
/usr/local/include/sndfile.hh:348: undefined reference to `sf_write_short'
collect2: error: ld returned 1 exit status
Makefile:22: recipe for target 'AudioEntropy' failed
make: *** [AudioEntropy] Error 1