I'm trying to compile a project (swac-record) that relies on qt, portaudio and FLAC. I'm on Mac OS X.
This is what I've got so far:
qmake swac-record-0.4 // This creates a Makefile at the same level as the project and .pro and .qrc files inside the project.
qmake swac-record-0.4/swac-record.pro // not sure what this does exactly
make // will compile the whole project
...but then compilation fails because some symbols cannot be resolved.
Undefined symbols for architecture x86_64:
"_FLAC__StreamDecoderErrorStatusString", referenced from:
DecoderFlac::error_callback(FLAC__StreamDecoderErrorStatus) in codec_flac.o
"_FLAC__StreamDecoderInitStatusString", referenced from:
DecoderFlac::decode(Channel&) in codec_flac.o
"_FLAC__metadata_object_new", referenced from:
EncoderFlac::setTag(Tag const&) in codec_flac.o
"_FLAC__metadata_object_vorbiscomment_append_comment", referenced from:
EncoderFlac::setTag(Tag const&) in codec_flac.o
"_FLAC__metadata_object_vorbiscomment_entry_from_name_value_pair", referenced from:
EncoderFlac::setTag(Tag const&) in codec_flac.o
I don't really have experience with C++. Anyway, my understanding of it is that compilation fails because it cannot find the FLAC library.
The project's website says it uses Flac++ (libflac++-dev) and it is referenced like so in the code:
#include <FLAC++/decoder.h>
#include <FLAC++/encoder.h>
My questions then become:
- How can I install libflac++? (Is it not included in
flac
already installed on the Mac?) - How can I link to libflac++?
I haven't had much luck researching this question (the closest I got is this question but I'm not using Xcode.)
EDIT: as ddriver's advised, I've built libflac myself and added it to the project.
Building libflac: I got the source code and compiled it using ./configure && make && make check && make install
. As far as I can tell it went fine:
pkg-config --list-all | grep FLAC++
ls /usr/local/lib | grep FLAC
flac++ FLAC++ - Free Lossless Audio Codec Library (C++ API)
libFLAC++.6.dylib
libFLAC++.a
libFLAC++.dylib
libFLAC++.la
Adding it to the project: I did so by editing swac-record.pro and adding the library like so (this thread helped):
INCLUDEPATH += /usr/local/lib
LIBS += -L"/usr/local/lib" -lFLAC++
However, I'm still getting the same Undefined symbols
error. What did I miss?