当前位置: 技术问答>linux和unix
关于Linux C引用静态类库的问题
来源: 互联网 发布时间:2017-05-28
本文导语: 本人初次接触Linux C编程。编译了一个静态类库spooles.a。在编译spooles.a之前,spooles文件夹中有mic.h等一系列头文件,spooles.h引用了misc.h等头文件。在另一个程序(CCX)中需要引用到这个类库。编译好了将其拷贝到/usr/li...
本人初次接触Linux C编程。编译了一个静态类库spooles.a。在编译spooles.a之前,spooles文件夹中有mic.h等一系列头文件,spooles.h引用了misc.h等头文件。在另一个程序(CCX)中需要引用到这个类库。编译好了将其拷贝到/usr/lib目录下。但是好像无法引用spooles.a啊!在CCX执行make命令的时候出现错误,显示如下:
In file included from arpack.c:26:
spooles.h:26:18: error: misc.h: No such file or directory
spooles.h:27:22: error: FrontMtx.h: No such file or directory
spooles.h:28:21: error: SymbFac.h: No such file or directory
请问这是什么问题?是我编译spooles.a出错了呢还是spooles.a文件拷贝的位置不对?求解答,最好详细点,谢谢!
In file included from arpack.c:26:
spooles.h:26:18: error: misc.h: No such file or directory
spooles.h:27:22: error: FrontMtx.h: No such file or directory
spooles.h:28:21: error: SymbFac.h: No such file or directory
请问这是什么问题?是我编译spooles.a出错了呢还是spooles.a文件拷贝的位置不对?求解答,最好详细点,谢谢!
|
gcc ... -I/your_header_file_path ...spooles.a
|
楼主 man gcc 看看怎么编译
|
|
头文件需要包括在gcc能找到的文件夹下