0

so I'm trying to write a program in Visual Studio (in C++) with use of libsndfile library, but I can't make it work. I have installed this library with vcpkg and when i try to run program from this site http://digitalsoundandmusic.com/5-3-3-reading-and-writing-formatted-audio-files-in-c/ I get 3 errors:

1>------ Build started: Project: ConsoleApplication4, Configuration: Debug Win32 ------
1>ConsoleApplication4.cpp
1>libsndfile.lib(flac.obj) : error LNK2001: unresolved external symbol _FLAC__StreamDecoderErrorStatusString
1>libsndfile.lib(flac.obj) : error LNK2001: unresolved external symbol _FLAC__StreamEncoderInitStatusString
1>C:\Users\asd\source\repos\ConsoleApplication4\Debug\ConsoleApplication4.exe : fatal error LNK1120: 2 unresolved externals
1>Done building project "ConsoleApplication4.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I tried also manually add this library but I had 68 errors similar to those above. Please, help me find solution. Thank you.

Ikaruga
  • 61
  • 9
  • Seems like you are missing a link to libFLAC – drescherjm Feb 19 '20 at 21:02
  • 1
    @drescherjm Ok, I edited my post. What can I do about missing libFLAC? – Ikaruga Feb 19 '20 at 21:20
  • I would expect that `vcpkg` built it and you need to add an additional library to your linker settings. – drescherjm Feb 19 '20 at 21:25
  • Thanks for the updated errors output. This is the preferred method on StackOverflow. The output tab is in a better format for copy / paste and occasionally there is additional output that is not in the errors list abbreviated format. – drescherjm Feb 19 '20 at 21:27
  • @drescherjm I found out that vcpkg have installed libflac on my computer. I found files FLAC.lib and FLAC++.lib and I've tried adding them to the project through the linker but unfortunately it still doesn't work (same result). Sorry if it wasn't what u meant by telling me to add an additional library. – Ikaruga Feb 19 '20 at 21:43
  • What I meant is here: [https://stackoverflow.com/questions/4445418/how-to-add-additional-libraries-to-visual-studio-project](https://stackoverflow.com/questions/4445418/how-to-add-additional-libraries-to-visual-studio-project) – drescherjm Feb 19 '20 at 21:52
  • @drescherjm This is what I did. Seems like I will have to find another library. Anyway, thank you for your help. – Ikaruga Feb 19 '20 at 22:00

0 Answers0