這邊筆記一下 用eclipse製作.so與 專案如何nclude的步驟
File->New->c/c++Project->c++Managed Build ->NEXT

Sharred Library ->Empty Project, Linux GCC

在此專案內新增hello.c與hello.h
新增一個hello():
專案->右鍵->Build Project
libhello.so->此檔為製作好的lib,只要金此檔案與hello.h加到專案內就可使用
- include lib的步驟
新增一個Test的專案,新增一個include資料夾與lib資料夾,將hello.h與libhello.so放入:

右鍵->properties->c/c++Build settings ->Tool Setting->GCC C Compiler ->includes
右邊的include path新增include的路徑:

GCC C++ LInker->MIscellaneous ->other object 新增hello.so:

完成後點選Apply and Close
編輯main.c:
完成後,用terminal開啟
留言
張貼留言