Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Issues with Audio module  (Read 3766 times)

0 Members and 1 Guest are viewing this topic.

Dinipants

  • Newbie
  • *
  • Posts: 16
    • View Profile
Issues with Audio module
« on: May 26, 2017, 10:54:38 am »
For reference, I used this tutorial: https://en.sfml-dev.org/forums/index.php?topic=17683.0

I've been using other SFML modules like System and Graphics with no issue. However, whenever I try to use something from the Audio module I get a bunch of undefined reference errors on building, e.g. ;

Quote
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderFlac.cpp:189: undefined reference to `FLAC__stream_decoder_new'
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderFlac.cpp:197: undefined reference to `FLAC__stream_decoder_init_stream'
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderFlac.cpp:200: undefined reference to `FLAC__stream_decoder_process_until_end_of_metadata'
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderFlac.cpp:203: undefined reference to `FLAC__stream_decoder_finish'
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderFlac.cpp:204: undefined reference to `FLAC__stream_decoder_delete'
C:\Users\Admin\Documents\SFML-2.4.2\lib/libsfml-audio-s-d.a(SoundFileReaderFlac.cpp.obj): In function `sf::priv::SoundFileReaderFlac::open(sf::InputStream&, sf::SoundFileReader::Info&)':
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderFlac.cpp:230: undefined reference to `FLAC__stream_decoder_new'
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderFlac.cpp:239: undefined reference to `FLAC__stream_decoder_init_stream'
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderFlac.cpp:242: undefined reference to `FLAC__stream_decoder_process_until_end_of_metadata'
C:\Users\Admin\Documents\SFML-2.4.2\lib/libsfml-audio-s-d.a(SoundFileReaderFlac.cpp.obj): In function `sf::priv::SoundFileReaderFlac::seek(unsigned long long)':
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderFlac.cpp:270: undefined reference to `FLAC__stream_decoder_seek_absolute'
C:\Users\Admin\Documents\SFML-2.4.2\lib/libsfml-audio-s-d.a(SoundFileReaderFlac.cpp.obj): In function `sf::priv::SoundFileReaderFlac::read(short*, unsigned long long)':
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderFlac.cpp:308: undefined reference to `FLAC__stream_decoder_process_single'
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderFlac.cpp:312: undefined reference to `FLAC__stream_decoder_get_state'
C:\Users\Admin\Documents\SFML-2.4.2\lib/libsfml-audio-s-d.a(SoundFileReaderFlac.cpp.obj): In function `sf::priv::SoundFileReaderFlac::close()':
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderFlac.cpp:325: undefined reference to `FLAC__stream_decoder_finish'
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderFlac.cpp:326: undefined reference to `FLAC__stream_decoder_delete'
C:\Users\Admin\Documents\SFML-2.4.2\lib/libsfml-audio-s-d.a(SoundFileReaderOgg.cpp.obj): In function `sf::priv::SoundFileReaderOgg::check(sf::InputStream&)':
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderOgg.cpp:77: undefined reference to `ov_test_callbacks'
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderOgg.cpp:79: undefined reference to `ov_clear'
C:\Users\Admin\Documents\SFML-2.4.2\lib/libsfml-audio-s-d.a(SoundFileReaderOgg.cpp.obj): In function `sf::priv::SoundFileReaderOgg::open(sf::InputStream&, sf::SoundFileReader::Info&)':
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderOgg.cpp:109: undefined reference to `ov_open_callbacks'
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderOgg.cpp:117: undefined reference to `ov_info'
D:/sfml-release/_Sources/SFML/src/SFML/Audio/SoundFileReaderOgg.cpp:120: undefined reference to `ov_pcm_total'

I'm using Eclipse Neon on Windows, I've included all the SFML modules in the Eclipse GCC C++ COmpiler and MinGW C++ linker settings the same way. Haven't had any issues with the library modules until this issue popped up.

Why is the undefined reference pointing to the D drive? Why doesn't the Audio module import work when all the other SFML modules worked?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Issues with Audio module
« Reply #1 on: May 26, 2017, 11:07:42 am »
You probably forgot to link to FLAC libraries. Look at the list of dependencies (in the getting started tutorial) to link when you use SFML statically.
Laurent Gomila - SFML developer

Dinipants

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Issues with Audio module
« Reply #2 on: May 26, 2017, 11:15:00 am »
You probably forgot to link to FLAC libraries. Look at the list of dependencies (in the getting started tutorial) to link when you use SFML statically.

I've linked every library that's in that tutorial (and from the SFML documentation, it says everything you need for development in a Windows environment is included in the SFML library, so do I need to include something that's not in that list?)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Issues with Audio module
« Reply #3 on: May 26, 2017, 11:18:47 am »
Can you show your linker settings?
Laurent Gomila - SFML developer

Dinipants

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Issues with Audio module
« Reply #4 on: May 26, 2017, 12:08:06 pm »
Can you show your linker settings?

these are my Eclipse includes (attached)

texus

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
    • TGUI
    • Email
Re: Issues with Audio module
« Reply #5 on: May 26, 2017, 12:53:18 pm »
The tutorial you followed is outdated. Look at the dependencies mentioned in the getting started tutorial instead (the tutorial is not for eclipse, but the dependencies are the same).
TGUI: C++ SFML GUI

Dinipants

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Issues with Audio module
« Reply #6 on: May 26, 2017, 01:24:48 pm »
The tutorial you followed is outdated. Look at the dependencies mentioned in the getting started tutorial instead (the tutorial is not for eclipse, but the dependencies are the same).

Thanks, that tutorial was outdated and I wasn't including all the FLAC and vorbis dependencies required (as per the your link). Cheers guys!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Issues with Audio module
« Reply #7 on: May 26, 2017, 01:27:58 pm »
Wiki, forum and youtube "tutorials" are not tutorials. They may help at some point, but they are also possibly wrong, and most likely outdated. The only reference is the official set of tutorials and API documentation on the official website.
Laurent Gomila - SFML developer

Dinipants

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Issues with Audio module
« Reply #8 on: May 26, 2017, 01:32:25 pm »
Wiki, forum and youtube "tutorials" are not tutorials. They may help at some point, but they are also possibly wrong, and most likely outdated. The only reference is the official set of tutorials and API documentation on the official website.

Yes, very true. The only reason I used that tutorial is because I hadn't used Eclipse in a while and Windows was being an ass pain (I usually develop in Linux). So I went to a tute that was specific for my IDE to help move things along. Was my mistake.

 

anything