C++ 库包含

C++ Library Include(C++ 库包含)
本文介绍了C++ 库包含的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I am relatively new to C++ and need to use a library for the first time. I was hoping someone would be able to show me how to properly [ link to / include ] the library.

The library I want to use is the ID3 v3.8.8 that can be found here: http://id3lib.sourceforge.net/

I have downloaded the Windows binaries and now just need a way to link to the library.

Files downloaded: Debug/id3lib.dll, Debug/id3lib.lib, Debug/id3lib.exp, Release/id3lib.dll, Release/id3lib.lib, Release/id3lib.exp

I am using Visual Studio 2010.

Any help is greatly appreciated. Thanks in advance.

解决方案

There are several steps, and many a pitfall. If you are a rank newbie at using C++ and VC++ in particular, every step is going to require some (gasp) reading of documentation or googling.

  • In VC++ 2010, use the Property Manager "C/C++ General / Additional Include Directories" section if necessary to tell the compiler how to find the header-files.
  • Use the Property Manager "C/C++/ Code Generation / Runtime Library" section if necessary to tell the compiler what version of the Microsoft C Runtime Library the library requires.
  • Use Property Manager "Linker / Input / Additional Dependencies " to specify the .lib file id3lib.lib.
  • Use Property Manager "Linker / General / Additional Library Directories" to tell the linker where to find .lib file.
  • If the dll id3lib.dll is not in the directory where you will start your program, open a Microsoft Explorer window, and right-click on "My Computer." Select "Properties/Advanced/Environment Variables", and edit the user-variable PATH to contain the path of the directory that contains the dll. Be very careful doing this. Before you change it, copy the value that's there originally and save it to a text file, in case you mess up and need to restore it. If you get it wrong, other programs can fail to start.

Good luck.

这篇关于C++ 库包含的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Clang Tool (libtooling): set header search path to standard libs headers. Foundation framework(Clang 工具 (libtooling):将标头搜索路径设置为标准库标头.基础框架)
How can I get the contents of a file at build time into my C++ string?(如何在构建时将文件的内容获取到我的 C++ 字符串中?)
C++ previous definition error(C++以前的定义错误)
Writing or Copying Visual C++ console output to text file(将 Visual C++ 控制台输出写入或复制到文本文件)
C++ class, its base class and circular include includes(C++ 类,它的基类和循环包含包括)
How to see the actual order of include files after preprocessing?(预处理后如何查看包含文件的实际顺序?)