如何将Eclipse c++项目构建为库并将其添加到另一个项目中
How to build Eclipse C++ project as a library and add it to another project
我有一个带有一些代码的标准Eclipse c++项目。如何将其编译为静态库并将其作为静态库添加到另一个Eclipse c++项目中?
请给我一步一步的指导
创建库:
File->new-> c++ Project->Project type->static library->empty Project .
添加库:
引用自文档:
Q. How do I add a static library file to a project? (Files such as libmtm.a)
A. First you will need to copy the file into your Eclipse project. You can do that by simply dragging it into the project folder in the "Project Explorer" tree in Eclipse. To link the library (A static library is used similarly to an object file):
Open Project, Properties.
In that dialog select "C++ Build, Settings".
Under the Tool Settings tab choose "Linker" or "MinGW C Linker" or equivalent and under that select "Libraries".
Under "Libraries" press the "Add..." button (the green cross) and write the name of the library without the "lib" prefix and ".a" suffix. e.g. in order to link the library file libmtm.a write "mtm".
Under "Library search path" press the "Add..." button, select workspace and select the project.
相关文章:
- 将项目添加到队列时运行线程
- 如何使用矢量元素将项目添加到结构中?
- 本机 Nuget 包安装在 VS 中,但没有为C++(本机)项目添加引用
- 如何将多个 QStringList 中的项目添加到一个
- CMake 和/或在为项目添加提升时出错
- 我无法将项目添加到 ( 标准::矢量 < 标准::矢量 <标准::字符串> > )
- 计数器将项目添加到数组中,并剩余
- 将CMAKE项目添加到Visual Studio解决方案中
- 如何使用QListView项目添加复选框
- C++将项目添加到集合中
- 在MFC中的树(ctreectrl)中的特定树项目添加图标
- 如何将类的项目添加到C 的数组中,而无需给它们命名
- 如何将项目添加到输出文件中
- CMAKE将新项目添加到解决方案中
- 如何将项目添加到QT中的布局中
- 将项目添加到双向链表的背面时遇到问题
- 捕获非默认文件夹上的项目添加事件
- wxWidgets-通过DLL将项目添加到sizer
- 使用.push_back将新创建的项目添加到库存
- 如何将MFC应用程序项目添加到Visual C 2008中的Win32应用程序项目