C ++库包含 [英] C++ Library Include

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

问题描述

我对C ++比较陌生,需要第一次使用库。
我希望有人能够告诉我如何正确地[链接到/包括]图书馆。



我想使用的图书馆是ID3 v3.8.8,可以在这里找到:
http://id3lib.sourceforge.net/



我已经下载了Windows二进制文件,现在只需要一种方法链接到库。



Debug / id3lib.dll,Debug / id3lib.lib,Debug / id3lib.exp,Release / id3lib.dll,Release / id3lib.lib,Release / id3lib.exp



我使用Visual Studio 2010。



任何帮助非常感谢。先感谢。

解决方案

有几个步骤,许多陷阱。如果你是使用C ++和VC ++的排名新手,每一步都需要一些(气体)文档或谷歌搜索。




  • 在VC ++ 2010中,如有必要,使用属性管理器C / C ++常规/附加包含目录部分告诉编译器如何查找头文件。

  • 使用属性管理器

  • 使用属性管理器链接器/输入/附加功能。如果需要,可以通过C / C ++ /代码生成/运行时库部分告诉编译器该库需要什么版本的Microsoft C运行时库。

  • 使用属性管理器链接器/常规/附加库目录告诉链接器在哪里可以找到.lib文件。

  • 如果dll id3lib.dll不在您要启动程序的目录中,请打开Microsoft Explorer窗口,然后右键单击我的电脑。选择属性/高级/环境变量,然后编辑用户变量PATH以包含包含dll的目录的路径。非常小心这样做。在更改它之前,复制原来的值,并将其保存到文本文件,以防万一你乱了,需要恢复它。

    祝你好运。


    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 ++库包含的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆