libsndfile を使用しようとしています。私はg ++もあまり得意ではありません。libsndfile のインストール方法は make install のようです。本当にできるので、ディレクトリにコンパイルしました。
ここでチュートリアルをコンパイルしようとしていました:
http://parumi.wordpress.com/2007/12/16/how-to-write-wav-files-in-c-using-libsndfile/
次のことを試すと:
g++ -Isrc/ test.c
私は得る:
/tmp/ccq5fhbT.o: In function SndfileHandle::SndfileHandle(char const*, int, int, int, int)':
test.c:(.text._ZN13SndfileHandleC1EPKciiii[SndfileHandle::SndfileHandle(char const*, int, int, int, int)]+0xf4): undefined reference to sf_open'
/tmp/ccq5fhbT.o: In function SndfileHandle::write(float const*, long)':
test.c:(.text._ZN13SndfileHandle5writeEPKfl[SndfileHandle::write(float const*, long)]+0x27): undefined reference to sf_write_float'
/tmp/ccq5fhbT.o: In function SndfileHandle::SNDFILE_ref::~SNDFILE_ref()':
test.c:(.text._ZN13SndfileHandle11SNDFILE_refD1Ev[SndfileHandle::SNDFILE_ref::~SNDFILE_ref()]+0x20): undefined reference to sf_close'
collect2: ld returned 1 exit status
次のことをしようとすると:
g++ -lsndfile -Isrc/ test.c
私は得る
/usr/bin/ld: cannot find -lsndfile
collect2: ld returned 1 exit status
g++ を指定する必要があるスイッチがわかりません。