“error LNK2019: unresolved external symbol” error in Visual Studio 2010

后端 未结 3 2197
野的像风
野的像风 2020-12-11 09:40

I\'m trying to compile and run a C code that is using libsndfile library for sound files processing.

I have added the header file using this path:

相关标签:
3条回答
  • 2020-12-11 10:24

    I faced the same problem. I solved it as follows.

    1)Make sure that you are downloading the 32 bit libsndfile(libsndfile-1.0.25-w32-setup.exe) package because the Visual studio compiler is 32 bit.

    2)Install the library by clicking on the setup.exe(libsndfile-1.0.25-w32-setup.exe) file of libsndfile.

    3)After creating your project, do the following 2 steps:

    i)Go to Debug >> Project Properties >> Configuration Properties >> C/C++ >> General >> Additional Include Directories >> Click on the arrow on the right hand side and then click on edit >> Here, add the path of the include folder in your libsndfile directory.

    ii)After step (i) is complete, click on Linker in Configuration Properties >> General >> Additional Library Directories >> Click on the arrow on the right hand side and then click on edit >> Here, add the path of the .lib file. You may have to type in the entire path since the browse option does not show the .lib file. So, in my case I typed C:\Program Files (x86)\Mega-Nerd\libsndfile\lib\libsndfile-1.lib.

    Finally, you are done! Your code should compile and work now without throwing any errors.

    0 讨论(0)
  • 2020-12-11 10:27

    I had a similar issue and the problem was mixing a x64 lib and a win32 project.

    0 讨论(0)
  • 2020-12-11 10:29

    Missing to specify the folder directory of the library (.lib added to Additional Dependencies) VC++ Directories view
    Click on Library Directories, click the drop-down button on the right and choose
    and specify the directory it should work.

    0 讨论(0)
提交回复
热议问题