1

Severity Code Description Project File Line Suppression State

Error   LNK2019 unresolved external symbol _sf_open referenced in function "private: unsigned int __thiscall SoundBuffer::AddSoundEffect(char const *)" (?AddSoundEffect@SoundBuffer@@AAEIPBD@Z)    Engines4    D:\xxx\xxxx\sound\PhysicsEngine\Engines4\SoundBuffer.obj

1
and three more similar LNK2019

I have done Properties >> General >> Additional Library Directories Debug >> Project Properties >> Configuration Properties >> C/C++ >> ,General >> Additional Include Directories

Installed the library libsndfile-1.0.25-w64-setup.exe file of libsndfile. I have exited, clean, and rebuild many times! And VS keeps crying...

Talha Tayyab
  • 8,111
  • 25
  • 27
  • 44
Ale
  • 13
  • 4
  • 1
    Did you add the library to the `Linker->Input -> Additional Dependencies` setting? I see you setting the include and linker path but not actually linking with the library. – drescherjm Oct 25 '21 at 03:10
  • did you include sndfile.h import? - stdio.h or for any reason also if its C++ cstdio import too? – Samuel Marchant Oct 25 '21 at 03:11
  • @drescherjm This is what it looks like SDL2.lib SDL2_image.lib SDL2main.lib SDL2test.lib glew32.lib glew32s.lib opengl32.lib OpenAL32.lib libsndfile-1.lib – Ale Oct 25 '21 at 03:30
  • @SamuelMarchant I did include sndfile.h, the program was working fine yesterday, it decided to die today :(( – Ale Oct 25 '21 at 03:35
  • Odd anyhow, but i notice your in windows so should .obj (i know thats compiler output of the binaries) be an exe or a dll when run, is the error function line in the same file as the import? (...external symbol...) LNK usually refers to a dll in win. – Samuel Marchant Oct 25 '21 at 03:49
  • @SamuelMarchant Thanks a lot, I fixed by LNK2019 by restarting my PC, should have done that before wasting many valuable hours. I really hate this, hope it doesn't come back and bite me. Thank you so much for you time ! PS: it happens to me sometimes. – Ale Oct 25 '21 at 04:15

0 Answers0