[Flac-dev] How do I use FLAC in my C++ program ?

David Collett jg at webone.com.au
Fri Apr 12 21:41:01 PDT 2002


Hello all,
I am writing a "virtual cdplayer" application, that plays tracks from my
cd backups, which are stored as a .flac file and a cdrwin style .cue
file. Anyway enough of that, onto the problem..

I wish to use C++ for my program, but when I try to compile it with g++
I get the following types of errors:

/home/dave/development/splitimg/splitimg.cpp:153: undefined reference to
`FLAC__file_decoder_new(void)'
/home/dave/development/splitimg/splitimg.cpp:154: undefined reference to
`FLAC__file_decoder_set_md5_checking(FLAC__FileDecoder const *, int)'

and so on, you get the idea... its not linking to libFLAC :(
my compile line is:
g++ -g -o splitimg splitimg.cpp -lao -ldl -lFLAC -lm

What is going wrong here, can I use libFLAC in C++ ?

I have written a (very)simple flac player in C and that compiles file
with gcc, so I know everythings installed correctly etc.

Any help would be greatly appreciated!
Thanks in advance,
David Collett

PS: I am using flac-1.0.2 under linux(sorcerer, gcc is version 2.95.3
20010315) if that helps!



 







More information about the Flac-dev mailing list