如何向 Visual Studio 项目添加其他库? [英] How to add additional libraries to Visual Studio project?

查看:37
本文介绍了如何向 Visual Studio 项目添加其他库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Allergro 是一个用于图形操作的开源 C++ 插件库.如何将此库添加到我的编译器中?

Allergro is an open souce C++ addon library for graphics manipulation. How do I add this library to my compiler?

这些说明对我不起作用,因为我使用的是 Windows 7.我不知道操作系统是否重要.我有 Visual Studio 速成版.该库是一个 .dll 文件.如何将其添加到我的项目中?

The instructions don't work for me as I have Windows 7. I don't know if the OS matters. I have the Visual Studio Express Edition. The library is a .dll file. How do I add it to my projects?

推荐答案

对于 Visual Studio,您需要在解决方案资源管理器中右键单击您的项目,然后单击属性.

For Visual Studio you'll want to right click on your project in the solution explorer and then click on Properties.

接下来打开配置属性,然后打开链接器.

Next open Configuration Properties and then Linker.

现在您要将拥有 Allegro 库的文件夹添加到附加库目录

Now you want to add the folder you have the Allegro libraries in to Additional Library Directories,

链接器 -> 输入,您将在附加依赖项下添加实际的库文件.

Linker -> Input you'll add the actual library files under Additional Dependencies.

对于头文件,您还需要将它们的目录包含在 C/C++ -> 其他包含目录.

For the Header Files you'll also want to include their directories under C/C++ -> Additional Include Directories.

如果有 dll,请在您的主项目文件夹中复制它,然后完成.

If there is a dll have a copy of it in your main project folder, and done.

我建议将 Allegro 文件放在您的项目文件夹中,然后在库和头目录中使用本地引用.

I would recommend putting the Allegro files in the your project folder and then using local references in for the library and header directories.

这样做将允许您在其他计算机上运行该应用程序,而无需在另一台计算机上安装 Allergo.

Doing this will allow you to run the application on other computers without having to install Allergo on the other computer.

这是为 Visual Studio 2008 编写的.对于 2010,它应该大致相同.

This was written for Visual Studio 2008. For 2010 it should be roughly the same.

这篇关于如何向 Visual Studio 项目添加其他库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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