项目中包括静态链接库

项目中包括静态链接库

本文介绍了如何在我的Eclipse C ++项目中包括静态链接库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个以源代码形式分发的开源库。在我运行Makefile后,我最终得到一个 .h 文件和一个 .a 文件,然后我想包括在我正在工作的项目。我熟悉如何通过手动编辑Makefile或通过从命令行调用编译器来添加这些,但我不知道如何添加这些到我的Eclipse C ++项目,使用。

I have an open-source library that's distributed in source form. After I run the Makefile, I end up with a .h file and a .a file that I then want to include in a project that I'm working on. I'm familiar with how I can add these by editing a Makefile manually or by invoking the compiler from the command line, but I'm not sure how I can add these to my Eclipse C++ project, created using the CDT.

我目前使用的是Eclipse Indigo。我发现一些老版本的Eclipse的说明,但菜单不是什么描述。我戳了一会儿,没有看到任何熟悉的东西。

I'm currently using Eclipse Indigo. I found some instructions for older versions of Eclipse, but the menus aren't what are described. I poked around a bit, and didn't see anything familiar.

推荐答案

右键单击项目浏览器中的项目名称打开项目,选择项目属性。然后选择C / C ++ General - >路径和符号 - > includes - > GNU C ++并将路径添加到头文件。你应该对你的库做同样的:C / C ++通用 - >路径和符号 - >库 - >添加,并添加你的库文件路径。

right click on the project name in the project explorer with the project being opened, select project properties. Then select C/C++ General -> Paths and Symbols -> includes -> GNU C++ and add the path to your header file. You should do the same for you library under : C/C++ General -> Paths and Symbols -> Libraries -> Add , and add your library file path.

这篇关于如何在我的Eclipse C ++项目中包括静态链接库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 15:52