4

I googled for a whole day and I'm goin' mad..

Well, that's my problem: I've written my vs project, I've specified all the "include" (by selecting project properties -> configuration properties -> VC++ directories) and all the extern libraries directories (in the same way). Then I specified all the additional libraries by selecting project properties -> Linker -> input -> Additional Dependencies and adding all the .lib files paths. I press F7, it compiles with no errors. I run the project and.. System Error: libsndfile-1.dll is missing.

That's okay, so I opened the vs console, I moved to libsndfile-1.def (and libsndfile-1.lib) path and I executed: "lib.exe libsndfile.def". Here I got another error: "LINK: fatal error lnk1104 lib.exe, impossible to open libsndfile.lib"

I tried to download libsndfile.dll from web but it still don't works. I've also tried to put all the libraries in my source files in visual studio.. but again, no way.

Where am I wrong?

Thank you in advance

EDIT: I've seen that vs doesn't find the other dll also!

Michele
  • 751
  • 1
  • 8
  • 16
  • did you copy all the required dll's into application folder or into %PATH% ? Just adding them to the project doesn't mean they'll be automatically copied to output folder. Try opening your app's exe file in Dependency Walker: http://www.dependencywalker.com/ and look if there are any errors. – surfen Oct 07 '12 at 10:07
  • you tried to execute "lib.exe libsndfile.def" - shouldn't it be "lib.exe libsdnfile-1.def"? – surfen Oct 07 '12 at 10:12
  • Do you mean to set the PATH variable by selecting Configuration Property -> Debug -> Environment? – Michele Oct 07 '12 at 10:31
  • I made a mistake here.. I typed "lib.exe libsdnfile-1.def" correctly on vs. Sorry – Michele Oct 07 '12 at 10:31
  • You need the same version of the dll (libsndfile-1.dll) in your application's directory at runtime, as the version that you use for linking. Alternatively you can copy this dll's into one of the folders that are set in your system %PATH% variable, but it's usually better to use application's folder. – surfen Oct 07 '12 at 10:37
  • do you mean that the libsndfile-1.dll I have downloaded doesn't fit with libsndfile-1.lib I already have? – Michele Oct 07 '12 at 10:45
  • Yes, I think that they might not match. Hovewer this should result in a different error than "libsndfile-1.dll is missing". – surfen Oct 07 '12 at 13:06
  • 1
    I solved simply placing all the dll files in the same directory of the .exe file – Michele Oct 07 '12 at 15:03
  • 1
    Great, copy this comment as an answer if you have enough reputation, and mark it as solution. This way others will know that your question is solved without going through all the comments. – surfen Oct 07 '12 at 15:52
  • @MicheleRullo Rullo - post your comment as an aswer and accep it. – MikroDel Feb 28 '13 at 14:09

2 Answers2

16

Please do not copy the DLL into the folder... this is annoying for other developers in your organisation; instead right-click your app and click properties, go into the Configuration Properties->Debugging and set the Environment value to:

PATH=C:\PathToInclude;%PATH%

this will add the path to your environment and merge it to your application environment.

Do that for all Configurations of your app.

talonmies
  • 70,661
  • 34
  • 192
  • 269
0

I solved simply placing all the dll files in the same directory of the .exe file

Michele
  • 751
  • 1
  • 8
  • 16