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

Author Topic: Errors when trying to link sfml-audio  (Read 6015 times)

0 Members and 1 Guest are viewing this topic.

Kamaitachi

  • Newbie
  • *
  • Posts: 28
    • View Profile
Errors when trying to link sfml-audio
« on: July 10, 2016, 12:14:42 am »
I get the following errors when I try to link the sfml-audio library:

Quote
Error   4   error LNK2019: unresolved external symbol __imp_alSourcei referenced in function "private: void __cdecl sf::SoundStream::streamData(void)" (?streamData@SoundStream@sf@@AEAAXXZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundStream.cpp.obj)   AIProject
Error   5   error LNK2001: unresolved external symbol __imp_alSourcei   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundSource.cpp.obj)   AIProject
Error   6   error LNK2019: unresolved external symbol __imp_alGetSourcef referenced in function "public: class sf::Time __cdecl sf::SoundStream::getPlayingOffset(void)const " (?getPlayingOffset@SoundStream@sf@@QEBA?AVTime@2@XZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundStream.cpp.obj)   AIProject
Error   7   error LNK2001: unresolved external symbol __imp_alGetSourcef   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundSource.cpp.obj)   AIProject
Error   8   error LNK2019: unresolved external symbol __imp_alGetSourcei referenced in function "private: void __cdecl sf::SoundStream::streamData(void)" (?streamData@SoundStream@sf@@AEAAXXZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundStream.cpp.obj)   AIProject
Error   9   error LNK2001: unresolved external symbol __imp_alGetSourcei   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundSource.cpp.obj)   AIProject
Error   10   error LNK2019: unresolved external symbol __imp_alSourcePlay referenced in function "public: void __cdecl sf::SoundStream::play(void)" (?play@SoundStream@sf@@QEAAXXZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundStream.cpp.obj)   AIProject
Error   11   error LNK2019: unresolved external symbol __imp_alSourceStop referenced in function "private: void __cdecl sf::SoundStream::streamData(void)" (?streamData@SoundStream@sf@@AEAAXXZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundStream.cpp.obj)   AIProject
Error   12   error LNK2019: unresolved external symbol __imp_alSourcePause referenced in function "public: void __cdecl sf::SoundStream::pause(void)" (?pause@SoundStream@sf@@QEAAXXZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundStream.cpp.obj)   AIProject
Error   13   error LNK2019: unresolved external symbol __imp_alSourceQueueBuffers referenced in function "private: bool __cdecl sf::SoundStream::fillAndPushBuffer(unsigned int)" (?fillAndPushBuffer@SoundStream@sf@@AEAA_NI@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundStream.cpp.obj)   AIProject
Error   14   error LNK2019: unresolved external symbol __imp_alSourceUnqueueBuffers referenced in function "private: void __cdecl sf::SoundStream::streamData(void)" (?streamData@SoundStream@sf@@AEAAXXZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundStream.cpp.obj)   AIProject
Error   15   error LNK2019: unresolved external symbol __imp_alGenBuffers referenced in function "private: void __cdecl sf::SoundStream::streamData(void)" (?streamData@SoundStream@sf@@AEAAXXZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundStream.cpp.obj)   AIProject
Error   16   error LNK2019: unresolved external symbol __imp_alDeleteBuffers referenced in function "private: void __cdecl sf::SoundStream::streamData(void)" (?streamData@SoundStream@sf@@AEAAXXZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundStream.cpp.obj)   AIProject
Error   17   error LNK2019: unresolved external symbol __imp_alBufferData referenced in function "private: bool __cdecl sf::SoundStream::fillAndPushBuffer(unsigned int)" (?fillAndPushBuffer@SoundStream@sf@@AEAA_NI@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundStream.cpp.obj)   AIProject
Error   18   error LNK2019: unresolved external symbol __imp_alGetBufferi referenced in function "private: void __cdecl sf::SoundStream::streamData(void)" (?streamData@SoundStream@sf@@AEAAXXZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundStream.cpp.obj)   AIProject
Error   19   error LNK2019: unresolved external symbol __imp_alGenSources referenced in function "public: __cdecl sf::SoundSource::SoundSource(class sf::SoundSource const &)" (??0SoundSource@sf@@QEAA@AEBV01@@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundSource.cpp.obj)   AIProject
Error   20   error LNK2019: unresolved external symbol __imp_alDeleteSources referenced in function "public: virtual __cdecl sf::SoundSource::~SoundSource(void)" (??1SoundSource@sf@@UEAA@XZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundSource.cpp.obj)   AIProject
Error   21   error LNK2019: unresolved external symbol __imp_alSourcef referenced in function "public: void __cdecl sf::SoundSource::setPitch(float)" (?setPitch@SoundSource@sf@@QEAAXM@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundSource.cpp.obj)   AIProject
Error   22   error LNK2019: unresolved external symbol __imp_alSource3f referenced in function "public: void __cdecl sf::SoundSource::setPosition(float,float,float)" (?setPosition@SoundSource@sf@@QEAAXMMM@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundSource.cpp.obj)   AIProject
Error   23   error LNK2019: unresolved external symbol __imp_alGetSource3f referenced in function "public: class sf::Vector3<float> __cdecl sf::SoundSource::getPosition(void)const " (?getPosition@SoundSource@sf@@QEBA?AV?$Vector3@M@2@XZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundSource.cpp.obj)   AIProject
Error   24   error LNK2019: unresolved external symbol __imp_alIsExtensionPresent referenced in function "public: static bool __cdecl sf::priv::AudioDevice::isExtensionSupported(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?isExtensionSupported@AudioDevice@priv@sf@@SA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(AudioDevice.cpp.obj)   AIProject
Error   25   error LNK2019: unresolved external symbol __imp_alGetEnumValue referenced in function "public: static int __cdecl sf::priv::AudioDevice::getFormatFromChannelCount(unsigned int)" (?getFormatFromChannelCount@AudioDevice@priv@sf@@SAHI@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(AudioDevice.cpp.obj)   AIProject
Error   26   error LNK2019: unresolved external symbol __imp_alcCreateContext referenced in function "public: __cdecl sf::priv::AudioDevice::AudioDevice(void)" (??0AudioDevice@priv@sf@@QEAA@XZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(AudioDevice.cpp.obj)   AIProject
Error   27   error LNK2019: unresolved external symbol __imp_alcMakeContextCurrent referenced in function "public: __cdecl sf::priv::AudioDevice::AudioDevice(void)" (??0AudioDevice@priv@sf@@QEAA@XZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(AudioDevice.cpp.obj)   AIProject
Error   28   error LNK2019: unresolved external symbol __imp_alcDestroyContext referenced in function "public: __cdecl sf::priv::AudioDevice::~AudioDevice(void)" (??1AudioDevice@priv@sf@@QEAA@XZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(AudioDevice.cpp.obj)   AIProject
Error   29   error LNK2019: unresolved external symbol __imp_alcOpenDevice referenced in function "public: __cdecl sf::priv::AudioDevice::AudioDevice(void)" (??0AudioDevice@priv@sf@@QEAA@XZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(AudioDevice.cpp.obj)   AIProject
Error   30   error LNK2019: unresolved external symbol __imp_alcCloseDevice referenced in function "public: __cdecl sf::priv::AudioDevice::~AudioDevice(void)" (??1AudioDevice@priv@sf@@QEAA@XZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(AudioDevice.cpp.obj)   AIProject
Error   31   error LNK2019: unresolved external symbol __imp_alcIsExtensionPresent referenced in function "public: static bool __cdecl sf::priv::AudioDevice::isExtensionSupported(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?isExtensionSupported@AudioDevice@priv@sf@@SA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(AudioDevice.cpp.obj)   AIProject
Error   32   error LNK2019: unresolved external symbol __imp_alGetError referenced in function "void __cdecl sf::priv::alCheckError(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned int)" (?alCheckError@priv@sf@@YAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@I@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(ALCheck.cpp.obj)   AIProject
Error   33   error LNK2019: unresolved external symbol sf_open referenced in function "public: bool __cdecl sf::priv::SoundFile::openRead(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?openRead@SoundFile@priv@sf@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundFile.cpp.obj)   AIProject
Error   34   error LNK2019: unresolved external symbol sf_open_virtual referenced in function "public: bool __cdecl sf::priv::SoundFile::openRead(void const *,unsigned __int64)" (?openRead@SoundFile@priv@sf@@QEAA_NPEBX_K@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundFile.cpp.obj)   AIProject
Error   35   error LNK2019: unresolved external symbol sf_strerror referenced in function "public: bool __cdecl sf::priv::SoundFile::openRead(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?openRead@SoundFile@priv@sf@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundFile.cpp.obj)   AIProject
Error   36   error LNK2019: unresolved external symbol sf_seek referenced in function "public: void __cdecl sf::priv::SoundFile::seek(class sf::Time)" (?seek@SoundFile@priv@sf@@QEAAXVTime@3@@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundFile.cpp.obj)   AIProject
Error   37   error LNK2019: unresolved external symbol sf_read_short referenced in function "public: unsigned __int64 __cdecl sf::priv::SoundFile::read(short *,unsigned __int64)" (?read@SoundFile@priv@sf@@QEAA_KPEAF_K@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundFile.cpp.obj)   AIProject
Error   38   error LNK2019: unresolved external symbol sf_write_short referenced in function "public: void __cdecl sf::priv::SoundFile::write(short const *,unsigned __int64)" (?write@SoundFile@priv@sf@@QEAAXPEBF_K@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundFile.cpp.obj)   AIProject
Error   39   error LNK2019: unresolved external symbol sf_close referenced in function "public: __cdecl sf::priv::SoundFile::~SoundFile(void)" (??1SoundFile@priv@sf@@QEAA@XZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundFile.cpp.obj)   AIProject
Error   40   error LNK1120: 33 unresolved externals   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\x64\Debug\AIProject.exe   AIProject

I added all the libraries mentioned in the tutorial, and I made sure to be running the correct build. Any ideas?

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Errors when trying to link sfml-audio
« Reply #1 on: July 10, 2016, 02:21:56 am »
It looks like you're linking statically. Are you also linking the extra dependencies required for static linking (you're using VC, right? it looks like VC output)?
See this list on the FAQ (although that list is also present on the tutorial).
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Kamaitachi

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Errors when trying to link sfml-audio
« Reply #2 on: July 10, 2016, 02:59:42 am »
Yes, I linked all the ones present in the "Setting up SFML" page (and FAQ), so openal32, etc should all be linked. Also yes, I am using VC2013.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Errors when trying to link sfml-audio
« Reply #3 on: July 10, 2016, 07:50:13 am »
Doesn't look like you're linking the SFML dependencies. Did you add them to the same project settings ad your using (e.g. debug vs release)?

Can you provide the full bild command?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Kamaitachi

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Errors when trying to link sfml-audio
« Reply #4 on: July 10, 2016, 08:04:56 am »
Went back, added all dependencies again, seems like they are being linked to... however, I am still getting errors with the audio, related to linking:

Quote
Error   4   error LNK2019: unresolved external symbol sf_open referenced in function "public: bool __cdecl sf::priv::SoundFile::openRead(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?openRead@SoundFile@priv@sf@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundFile.cpp.obj)   AIProject
Error   5   error LNK2019: unresolved external symbol sf_open_virtual referenced in function "public: bool __cdecl sf::priv::SoundFile::openRead(void const *,unsigned __int64)" (?openRead@SoundFile@priv@sf@@QEAA_NPEBX_K@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundFile.cpp.obj)   AIProject
Error   6   error LNK2019: unresolved external symbol sf_strerror referenced in function "public: bool __cdecl sf::priv::SoundFile::openRead(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?openRead@SoundFile@priv@sf@@QEAA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundFile.cpp.obj)   AIProject
Error   7   error LNK2019: unresolved external symbol sf_seek referenced in function "public: void __cdecl sf::priv::SoundFile::seek(class sf::Time)" (?seek@SoundFile@priv@sf@@QEAAXVTime@3@@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundFile.cpp.obj)   AIProject
Error   8   error LNK2019: unresolved external symbol sf_read_short referenced in function "public: unsigned __int64 __cdecl sf::priv::SoundFile::read(short *,unsigned __int64)" (?read@SoundFile@priv@sf@@QEAA_KPEAF_K@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundFile.cpp.obj)   AIProject
Error   9   error LNK2019: unresolved external symbol sf_write_short referenced in function "public: void __cdecl sf::priv::SoundFile::write(short const *,unsigned __int64)" (?write@SoundFile@priv@sf@@QEAAXPEBF_K@Z)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundFile.cpp.obj)   AIProject
Error   10   error LNK2019: unresolved external symbol sf_close referenced in function "public: __cdecl sf::priv::SoundFile::~SoundFile(void)" (??1SoundFile@priv@sf@@QEAA@XZ)   C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\AIProject\sfml-audio-s-d.lib(SoundFile.cpp.obj)   AIProject

Full build command is:
Quote
/OUT:"C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\x64\Debug\AIProject.exe" /MANIFEST /NXCOMPAT /PDB:"C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\x64\Debug\AIProject.pdb" /DYNAMICBASE "winmm.lib" "opengl32.lib" "gdi32.lib" "glew.lib" "jpeg.lib" "freetype.lib" "openal32.lib" "flac.lib" "vorbisenc.lib" "vorbisfile.lib" "vorbis.lib" "ogg.lib" "sfml-audio-s-d.lib" "sfml-graphics-s-d.lib" "sfml-window-s-d.lib" "sfml-system-s-d.lib" "kernel32.lib" "user32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /DEBUG /MACHINE:X64 /INCREMENTAL /PGD:"C:\Users\MKH\Desktop\MMBN - The AI\AIProject\AIProject\x64\Debug\AIProject.pgd" /SUBSYSTEM:WINDOWS /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"x64\Debug\AIProject.exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:".\SFML-2.2\lib" /TLBID:1

(Is that the command you wanted?)

BTW, this is the exact order of the dependencies:
Quote
winmm.lib
opengl32.lib
gdi32.lib
glew.lib
jpeg.lib
freetype.lib
openal32.lib
flac.lib
vorbisenc.lib
vorbisfile.lib
vorbis.lib
ogg.lib
sfml-audio-s-d.lib
sfml-graphics-s-d.lib
sfml-window-s-d.lib
sfml-system-s-d.lib
kernel32.lib
user32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
odbccp32.lib
« Last Edit: July 10, 2016, 08:14:21 am by Kamaitachi »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Errors when trying to link sfml-audio
« Reply #5 on: July 10, 2016, 06:12:20 pm »
What version of SFML are you using? Since you're linking GLEW and the missing symbols are from libsndfile, it seems like you're using an old SFML version which the mentioned FAQ and tutorials are not written for.

Also with VS the order of the libraries to link doesn't matter.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Kamaitachi

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Errors when trying to link sfml-audio
« Reply #6 on: July 10, 2016, 06:17:12 pm »
I am using SFML-2.2.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Errors when trying to link sfml-audio
« Reply #7 on: July 10, 2016, 06:21:27 pm »
I suggest you update to the latest version, but in case you don't want to, you should follow the SFML 2.2 tutorial: http://www.sfml-dev.org/tutorials/2.2/start-vc.php

For SFML 2.2 the audio dependencies were just OpenAL and libsndfile.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/