0
我有一個帶有一些代碼的標準Eclipse C++項目。如何將其編譯爲靜態庫並將其作爲靜態庫添加到另一個Eclipse C++項目中?如何將Eclipse C++項目構建爲庫並將其添加到另一個項目
請給我一步一步的指示。
我有一個帶有一些代碼的標準Eclipse C++項目。如何將其編譯爲靜態庫並將其作爲靜態庫添加到另一個Eclipse C++項目中?如何將Eclipse C++項目構建爲庫並將其添加到另一個項目
請給我一步一步的指示。
做的圖書館:
文件 - >新建 - > C++項目 - >項目類型 - >靜態庫 - >空項目。
添加庫:從文檔
報價:
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.
你還可以看到: http://stackoverflow.com/questions/13746380/cant-add-static-library-in -eclipse-juno-8-1-1-cdt-c-project http://webcourse.cs.technion.ac.il/234122/Spring2012/en/faq_Working%20with%20Eclipse%20CDT.html –