头文件与库文件,头文件桥梁作用如何体现

zhi_oo 2014-10-21 11:29:20
我们在自己编写一个动态库的时候,并未提供头文件让其调用者包含,只是在编译时指定库文件路径及库文件名称。
为什么调用系统这种正规接口时,必须要包含头文件找到接口,再指定库名(路径默认),然后才可以调用呢?

头文件的桥梁作用究竟是如何体现的?
...全文
87 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
shared library will not get involved into compiling process, it is only referred during linking process. I wonder how you could successfully compile your codes with reference to the type/function inside the shared library without including library's header file? Compiler doesn't care the implementation of these types/functions, but it does care about the declaration of them...

23,124

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧