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

Author Topic: undefined reference to `vorbis..'  (Read 3112 times)

0 Members and 1 Guest are viewing this topic.

LinasNikis

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
undefined reference to `vorbis..'
« on: June 07, 2015, 05:29:14 pm »
I'm using C::B, sfml 2.3 GCC 4.7.1 TDM (SJLJ) - 32-bit, GNU GCC Compiler 4.7.1. When i try to compile this code:
#include <SFML/Audio.hpp>

int main()
{
    sf::Sound sound;
    return 0;
}
 
It gives me these errors:
||=== Build: Debug in Mars(compiler: GNU GCC Compiler) ===|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_packet_blocksize'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_synthesis_halfrate_p'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_synthesis'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_synthesis_halfrate_p'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_synthesis_halfrate_p'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_synthesis'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_synthesis_halfrate_p'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_synthesis_halfrate_p'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_packet_blocksize'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_packet_blocksize'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_synthesis_halfrate_p'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_synthesis_trackonly'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_synthesis_halfrate'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_synthesis_halfrate'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_synthesis_halfrate_p'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_synthesis_halfrate_p'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_synthesis_halfrate_p'|
D:\Downloads\Programs\GAMES\DEVELOPMENT\SFML-2.3\lib\libvorbisfile.a(vorbisfile.o):vorbisfile.c|| undefined reference to `vorbis_synthesis_halfrate_p'|
||=== Build failed: 18 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
 
I don't know what is the cause of this.
Sorry for bad english.
Please help.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: undefined reference to `vorbis..'
« Reply #1 on: June 07, 2015, 05:34:43 pm »
Are you linking sfml statically? In that case, are you remembering to link all the dependencies explicitly (and in the correct order)?
Read this (all of it! and especially all the red boxes): http://www.sfml-dev.org/tutorials/2.3/start-cb.php
« Last Edit: June 07, 2015, 05:43:13 pm by Jesper Juhl »

LinasNikis

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: undefined reference to `vorbis..'
« Reply #2 on: June 07, 2015, 07:15:59 pm »
Yes I'm linking statically.
My configuration for debug is:
sfml-graphics-s-d
sfml-window-s-d
sfml-audio-s-d
sfml-network-s-d
sfml-system-s-d
opengl32
freetype
jpeg
winmm
gdi32
openal32
flac
vorbis
vorbisenc
vorbisfile
ogg
ws2_32
 

LinasNikis

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: undefined reference to `vorbis..'
« Reply #3 on: June 09, 2015, 04:08:00 pm »
Okay. That's weird. If i link dynamically then everything works. Any ideas?
« Last Edit: June 09, 2015, 04:14:03 pm by LinasNikis »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: undefined reference to `vorbis..'
« Reply #4 on: June 09, 2015, 04:26:58 pm »
Try to put vorbis after vorbisfile and vorbisenc in the list.
Laurent Gomila - SFML developer

LinasNikis

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: undefined reference to `vorbis..'
« Reply #5 on: June 09, 2015, 04:50:06 pm »
Thank you Laurent. It works now. But on official tutorial for C::B sfml 2.3
(http://www.sfml-dev.org/tutorials/2.3/start-cb.php)
vorbis is before vorbisfile and vorbisenc. Thank you!