繁体   English   中英

C:如何包含壁球压缩库?

[英]C: How to include the squash compression library?

我对使用c进行编程非常陌生,并且很难将squash库包含到我的程序中。

我克隆了存储库并运行./configuremake sudo make install

安装文件:

/usr/local/lib/pkgconfig/squash-0.8.pc
/usr/local/lib/libsquash0.8.so.0.8
/usr/local/lib/libsquash0.8.so.0.8.0
/usr/local/lib/libsquash0.8.so
/usr/local/lib/cmake/Squash-0.8.0/SquashConfig.cmake
/usr/local/bin/squash

此目录中还有更多文件:

/usr/local/include/squash-0.8/
/usr/local/lib/squash/0.8/plugins/

在壁球示例中,该库包含在#include <squash/squash.h>但是当我尝试对其进行编译时,出现fatal error: squash/squash.h: No such file or directory

另外#include <squash-0.8/squash.h>不起作用,因为然后出现fatal error: hedley/hedley.h: No such file or directory该文件位于/usr/local/include/squash-0.8/squash/hedley/hedley.h

我想对于有经验的C程序员来说,解决方案非常简单,但是我在这里失败了。

我是否需要设置某种环境变量以让编译器找到该库?

以及如何将库链接到编译器? 我发现类似:

-rdynamic ../squash/libsquash0.8.so.0.8但由于上述错误而无法对其进行测试。

尝试改变

#include <squash/squash.h> 

#include "squash/hedley/hedley.h"

要么

#include "<squash-0.8/squash/hedley/hedley.h>"

更简单,更快捷的解决方案是在编译过程中将路径添加到您的包含文件中:

-I/usr/local/include/squash-0.8/squash/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM