Linker errors caused by Ogg Vorbis lib since upgrade to JUCE 4


#1

I just upgraded from JUCE 3.x to 4.02 via git, and my project now fails to build with a bunch of linker errors caused by the Ogg Vorbis library included by the OggVorbisAudioFormat class. I've done a google search and nobody else seems to have this problem, which suggests I'm doing something wrong, but what? Here are the linker errors:

Undefined symbols for architecture x86_64:

  "_ogg_page_bos", referenced from:

      _ov_pcm_seek in juce_audio_formats.o

      _ov_raw_seek in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_and_process_packet(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::ogg_packet*, int, int) in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_headers(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*, juce::OggVorbisNamespace::vorbis_comment*, long**, int*, juce::OggVorbisNamespace::ogg_page*) in juce_audio_formats.o

      juce::OggVorbisNamespace::_initial_pcmoffset(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*) in juce_audio_formats.o

  "_ogg_page_continued", referenced from:

      _ov_pcm_seek_page in juce_audio_formats.o

  "_ogg_page_eos", referenced from:

      _ov_raw_seek in juce_audio_formats.o

      juce::OggWriter::writeSamples(int) in juce_audio_formats.o

  "_ogg_page_granulepos", referenced from:

      _ov_pcm_seek_page in juce_audio_formats.o

      juce::OggVorbisNamespace::_initial_pcmoffset(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*) in juce_audio_formats.o

      juce::OggVorbisNamespace::_get_prev_page_serial(juce::OggVorbisNamespace::OggVorbis_File*, long*, int, int*, long long*) in juce_audio_formats.o

  "_ogg_page_serialno", referenced from:

      _ov_pcm_seek in juce_audio_formats.o

      _ov_raw_seek in juce_audio_formats.o

      _ov_pcm_seek_page in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_and_process_packet(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::ogg_packet*, int, int) in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_headers(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*, juce::OggVorbisNamespace::vorbis_comment*, long**, int*, juce::OggVorbisNamespace::ogg_page*) in juce_audio_formats.o

      juce::OggVorbisNamespace::_lookup_page_serialno(juce::OggVorbisNamespace::ogg_page*, long*, int) in juce_audio_formats.o

      juce::OggVorbisNamespace::_add_serialno(juce::OggVorbisNamespace::ogg_page*, long**, int*) in juce_audio_formats.o

      ...

  "_ogg_stream_clear", referenced from:

      _ov_clear in juce_audio_formats.o

      _ov_raw_seek in juce_audio_formats.o

      juce::OggWriter::~OggWriter() in juce_audio_formats.o

  "_ogg_stream_flush", referenced from:

      juce::OggWriter::OggWriter(juce::OutputStream*, double, unsigned int, unsigned int, int, juce::StringPairArray const&) in juce_audio_formats.o

  "_ogg_stream_init", referenced from:

      juce::OggVorbisNamespace::_ov_open1(void*, juce::OggVorbisNamespace::OggVorbis_File*, char const*, long, juce::OggVorbisNamespace::ov_callbacks) in juce_audio_formats.o

      _ov_raw_seek in juce_audio_formats.o

      juce::OggWriter::OggWriter(juce::OutputStream*, double, unsigned int, unsigned int, int, juce::StringPairArray const&) in juce_audio_formats.o

  "_ogg_stream_packetin", referenced from:

      juce::OggWriter::OggWriter(juce::OutputStream*, double, unsigned int, unsigned int, int, juce::StringPairArray const&) in juce_audio_formats.o

      juce::OggWriter::writeSamples(int) in juce_audio_formats.o

  "_ogg_stream_packetout", referenced from:

      _ov_pcm_seek in juce_audio_formats.o

      _ov_raw_seek in juce_audio_formats.o

      _ov_pcm_seek_page in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_and_process_packet(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::ogg_packet*, int, int) in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_headers(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*, juce::OggVorbisNamespace::vorbis_comment*, long**, int*, juce::OggVorbisNamespace::ogg_page*) in juce_audio_formats.o

      juce::OggVorbisNamespace::_initial_pcmoffset(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*) in juce_audio_formats.o

  "_ogg_stream_packetpeek", referenced from:

      _ov_pcm_seek in juce_audio_formats.o

      _ov_pcm_seek_page in juce_audio_formats.o

  "_ogg_stream_pagein", referenced from:

      _ov_pcm_seek in juce_audio_formats.o

      _ov_raw_seek in juce_audio_formats.o

      _ov_pcm_seek_page in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_and_process_packet(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::ogg_packet*, int, int) in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_headers(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*, juce::OggVorbisNamespace::vorbis_comment*, long**, int*, juce::OggVorbisNamespace::ogg_page*) in juce_audio_formats.o

      juce::OggVorbisNamespace::_initial_pcmoffset(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*) in juce_audio_formats.o

  "_ogg_stream_pageout", referenced from:

      juce::OggWriter::writeSamples(int) in juce_audio_formats.o

  "_ogg_stream_reset", referenced from:

      _ov_raw_seek in juce_audio_formats.o

  "_ogg_stream_reset_serialno", referenced from:

      _ov_pcm_seek in juce_audio_formats.o

      _ov_raw_seek in juce_audio_formats.o

      _ov_pcm_seek_page in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_and_process_packet(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::ogg_packet*, int, int) in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_headers(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*, juce::OggVorbisNamespace::vorbis_comment*, long**, int*, juce::OggVorbisNamespace::ogg_page*) in juce_audio_formats.o

  "_ogg_sync_buffer", referenced from:

      juce::OggVorbisNamespace::_ov_open1(void*, juce::OggVorbisNamespace::OggVorbis_File*, char const*, long, juce::OggVorbisNamespace::ov_callbacks) in juce_audio_formats.o

      juce::OggVorbisNamespace::_get_data(juce::OggVorbisNamespace::OggVorbis_File*) in juce_audio_formats.o

  "_ogg_sync_clear", referenced from:

      _ov_clear in juce_audio_formats.o

  "_ogg_sync_init", referenced from:

      juce::OggVorbisNamespace::_ov_open1(void*, juce::OggVorbisNamespace::OggVorbis_File*, char const*, long, juce::OggVorbisNamespace::ov_callbacks) in juce_audio_formats.o

  "_ogg_sync_pageseek", referenced from:

      juce::OggVorbisNamespace::_get_next_page(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::ogg_page*, long long) in juce_audio_formats.o

  "_ogg_sync_reset", referenced from:

      juce::OggVorbisNamespace::_seek_helper(juce::OggVorbisNamespace::OggVorbis_File*, long long) in juce_audio_formats.o

  "_ogg_sync_wrote", referenced from:

      juce::OggVorbisNamespace::_ov_open1(void*, juce::OggVorbisNamespace::OggVorbis_File*, char const*, long, juce::OggVorbisNamespace::ov_callbacks) in juce_audio_formats.o

      juce::OggVorbisNamespace::_get_data(juce::OggVorbisNamespace::OggVorbis_File*) in juce_audio_formats.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)


#2

No idea.. All that code is hidden away internally and there's not really any scope for it going wrong. Maybe try re-cloning the repo?


#3

Yep, that did it. Something must have gone wrong during the clone. My connection's been flaky so mabe that's it. Many thanks!


#4

I have the exact same problem, and cloning didn't fix it...! 

Undefined symbols for architecture x86_64:

  "_ogg_page_bos", referenced from:

      _ov_pcm_seek in juce_audio_formats.o

      _ov_raw_seek in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_and_process_packet(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::ogg_packet*, int, int) in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_headers(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*, juce::OggVorbisNamespace::vorbis_comment*, long**, int*, juce::OggVorbisNamespace::ogg_page*) in juce_audio_formats.o

      juce::OggVorbisNamespace::_initial_pcmoffset(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*) in juce_audio_formats.o

  "_ogg_page_continued", referenced from:

      _ov_pcm_seek_page in juce_audio_formats.o

  "_ogg_page_eos", referenced from:

      _ov_raw_seek in juce_audio_formats.o

      juce::OggWriter::writeSamples(int) in juce_audio_formats.o

  "_ogg_page_granulepos", referenced from:

      _ov_pcm_seek_page in juce_audio_formats.o

      juce::OggVorbisNamespace::_initial_pcmoffset(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*) in juce_audio_formats.o

      juce::OggVorbisNamespace::_get_prev_page_serial(juce::OggVorbisNamespace::OggVorbis_File*, long*, int, int*, long long*) in juce_audio_formats.o

  "_ogg_page_serialno", referenced from:

      _ov_pcm_seek in juce_audio_formats.o

      _ov_raw_seek in juce_audio_formats.o

      _ov_pcm_seek_page in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_and_process_packet(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::ogg_packet*, int, int) in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_headers(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*, juce::OggVorbisNamespace::vorbis_comment*, long**, int*, juce::OggVorbisNamespace::ogg_page*) in juce_audio_formats.o

      juce::OggVorbisNamespace::_lookup_page_serialno(juce::OggVorbisNamespace::ogg_page*, long*, int) in juce_audio_formats.o

      juce::OggVorbisNamespace::_add_serialno(juce::OggVorbisNamespace::ogg_page*, long**, int*) in juce_audio_formats.o

      ...

  "_ogg_stream_clear", referenced from:

      _ov_clear in juce_audio_formats.o

      _ov_raw_seek in juce_audio_formats.o

      juce::OggWriter::~OggWriter() in juce_audio_formats.o

  "_ogg_stream_flush", referenced from:

      juce::OggWriter::OggWriter(juce::OutputStream*, double, unsigned int, unsigned int, int, juce::StringPairArray const&) in juce_audio_formats.o

  "_ogg_stream_init", referenced from:

      juce::OggVorbisNamespace::_ov_open1(void*, juce::OggVorbisNamespace::OggVorbis_File*, char const*, long, juce::OggVorbisNamespace::ov_callbacks) in juce_audio_formats.o

      _ov_raw_seek in juce_audio_formats.o

      juce::OggWriter::OggWriter(juce::OutputStream*, double, unsigned int, unsigned int, int, juce::StringPairArray const&) in juce_audio_formats.o

  "_ogg_stream_packetin", referenced from:

      juce::OggWriter::OggWriter(juce::OutputStream*, double, unsigned int, unsigned int, int, juce::StringPairArray const&) in juce_audio_formats.o

      juce::OggWriter::writeSamples(int) in juce_audio_formats.o

  "_ogg_stream_packetout", referenced from:

      _ov_pcm_seek in juce_audio_formats.o

      _ov_raw_seek in juce_audio_formats.o

      _ov_pcm_seek_page in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_and_process_packet(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::ogg_packet*, int, int) in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_headers(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*, juce::OggVorbisNamespace::vorbis_comment*, long**, int*, juce::OggVorbisNamespace::ogg_page*) in juce_audio_formats.o

      juce::OggVorbisNamespace::_initial_pcmoffset(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*) in juce_audio_formats.o

  "_ogg_stream_packetpeek", referenced from:

      _ov_pcm_seek in juce_audio_formats.o

      _ov_pcm_seek_page in juce_audio_formats.o

  "_ogg_stream_pagein", referenced from:

      _ov_pcm_seek in juce_audio_formats.o

      _ov_raw_seek in juce_audio_formats.o

      _ov_pcm_seek_page in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_and_process_packet(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::ogg_packet*, int, int) in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_headers(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*, juce::OggVorbisNamespace::vorbis_comment*, long**, int*, juce::OggVorbisNamespace::ogg_page*) in juce_audio_formats.o

      juce::OggVorbisNamespace::_initial_pcmoffset(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*) in juce_audio_formats.o

  "_ogg_stream_pageout", referenced from:

      juce::OggWriter::writeSamples(int) in juce_audio_formats.o

  "_ogg_stream_reset", referenced from:

      _ov_raw_seek in juce_audio_formats.o

  "_ogg_stream_reset_serialno", referenced from:

      _ov_pcm_seek in juce_audio_formats.o

      _ov_raw_seek in juce_audio_formats.o

      _ov_pcm_seek_page in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_and_process_packet(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::ogg_packet*, int, int) in juce_audio_formats.o

      juce::OggVorbisNamespace::_fetch_headers(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::vorbis_info*, juce::OggVorbisNamespace::vorbis_comment*, long**, int*, juce::OggVorbisNamespace::ogg_page*) in juce_audio_formats.o

  "_ogg_sync_buffer", referenced from:

      juce::OggVorbisNamespace::_ov_open1(void*, juce::OggVorbisNamespace::OggVorbis_File*, char const*, long, juce::OggVorbisNamespace::ov_callbacks) in juce_audio_formats.o

      juce::OggVorbisNamespace::_get_data(juce::OggVorbisNamespace::OggVorbis_File*) in juce_audio_formats.o

  "_ogg_sync_clear", referenced from:

      _ov_clear in juce_audio_formats.o

  "_ogg_sync_init", referenced from:

      juce::OggVorbisNamespace::_ov_open1(void*, juce::OggVorbisNamespace::OggVorbis_File*, char const*, long, juce::OggVorbisNamespace::ov_callbacks) in juce_audio_formats.o

  "_ogg_sync_pageseek", referenced from:

      juce::OggVorbisNamespace::_get_next_page(juce::OggVorbisNamespace::OggVorbis_File*, juce::OggVorbisNamespace::ogg_page*, long long) in juce_audio_formats.o

  "_ogg_sync_reset", referenced from:

      juce::OggVorbisNamespace::_seek_helper(juce::OggVorbisNamespace::OggVorbis_File*, long long) in juce_audio_formats.o

  "_ogg_sync_wrote", referenced from:

      juce::OggVorbisNamespace::_ov_open1(void*, juce::OggVorbisNamespace::OggVorbis_File*, char const*, long, juce::OggVorbisNamespace::ov_callbacks) in juce_audio_formats.o

      juce::OggVorbisNamespace::_get_data(juce::OggVorbisNamespace::OggVorbis_File*) in juce_audio_formats.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

#5

Sorry, once I deleted and replaced my internal juce modules with the freshly cloned ones, it worked...!