简体   繁体   English

如何在Visual Studio 2008中使用.a lib文件?

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

So I have some C/C++ library compiled into .a files. 所以我将一些C / C ++库编译成.a文件。 library is ffmpeg (52) . library是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)? 任何人都可以向我提供有关如何在visual studio 2008中使用它的详细说明(如何将它链接到VS以便编译器可以找到它等等)?

Please rename your file from .a to .lib, and place it along with the source files of the project. 请将您的文件从.a重命名为.lib,并将其与项目的源文件一起放置。

Now go to project's properties and in the VS C++ include directories add the path of the header/include files for that lib. 现在转到项目的属性,并在VS C ++ include目录中添加该lib的header / include文件的路径。

To use the symbols in a source file write 要在源文件中使用符号写入

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM