How to use .a lib files with Visual Studio 2008?

2019-02-24 01:02发布

问题:

So I have some C/C++ library compiled into .a files. library is ffmpeg (52). Could any one provide me with detailed instructions on how to use it in visual studio 2008 (how to link it to VS so that compiler would find it and so on)?

回答1:

This might be useful: From MinGW static library (.a) to Visual Studio static library (.lib)



回答2:

Please rename your file from .a to .lib, and place it along with the source files of the project.

Now go to project's properties and in the VS C++ include directories add the path of the header/include files for that lib.

To use the symbols in a source file write

#pragma comment(lib, "your library's name")