0

I have compiled libFLAC from source code under macintosh os x 10.6.8 and tested WAV to FLAC conversion with success (from the command line). I have also used the default build as such: ./configure --prefix="$base/flac/more/" --exec-prefix="$base/flac/main/" --disable-asm-optimizations && make && make install

Now after adding the paths for FLAC headers and the libs into a brand new project. I am attempting to decode and load FLAC audio into system memory using libFLAC, under the example code which was bundled with libFLAC. However i am getting symbols not found errors with Standard C and vtable symbols not found errors with the Standard C++ approach (as seen below).

Errors under the C approach:

"FLAC_stream_decoder_get_state", referenced from:

  _main in main.o

"FLAC_stream_decoder_new", referenced from:

  _main in main.o

"FLAC_StreamDecoderStateString", referenced from:

  _main in main.o

"FLAC_StreamDecoderErrorStatusString", referenced from:

  error_callback(FLAC__StreamDecoder const*, 

FLAC__StreamDecoderErrorStatus, void*)in main.o

"FLAC_stream_decoder_init_file", referenced from:

  _main in main.o

"FLAC_StreamDecoderInitStatusString", referenced from:

  _main in main.o

"FLAC_stream_decoder_set_md5_checking", referenced from:

  _main in main.o

"FLAC_stream_decoder_process_until_end_of_stream", referenced from:

  _main in main.o

"FLAC_stream_decoder_delete", referenced from:

  _main in main.o

ld: symbol(s) not found

collect2: ld returned 1 exit status

From what i can understand is either: the linker is not seeing the libs (because it is seeing the headers) or the libFLAC was not compiled correctly. I'll be thankful if anyone will point me to possible solutions given these errors.

greg-449
  • 109,219
  • 232
  • 102
  • 145
8-bitButterfly
  • 203
  • 2
  • 13
  • What *exact* command is causing this error? – rubenvb Nov 28 '13 at 10:20
  • @rubenvb These errors are during the compiling of this example code https://github.com/oneman/libflac/blob/master/examples/c/decode/file/main.c under C and under C++ this https://github.com/oneman/libflac/blob/master/examples/cpp/decode/file/main.cpp – 8-bitButterfly Nov 28 '13 at 10:24

1 Answers1

0

I was doing the linking incorrectly. Linking needs to be done according to this stackoverflow post Adding static library inside Xcode C++ project (How to add static libraries inside a C++ project with Xcode) but i was adding the linking directory under the Project Setting where i was adding my headers path, thus it was not working.

Community
  • 1
  • 1
8-bitButterfly
  • 203
  • 2
  • 13