macOS 编译 xchm

先看看编译后的程序:


image.png

先把相关文件下载:

  1. chmlib http://www.jedrea.com/chmlib/
  2. wxWidgets https://www.wxwidgets.org/downloads/
  3. xchm https://github.com/rzvncj/xCHM

分别解压,先编译和安装chmlib和wxWidgets,用terminal打开所在目录,执行:

./configure && make 

wxWidgets 编译时间较长,chmlib相对较快。

make install

完成后,提示chmlib安装在

ls /usr/local/lib/libchm.
libchm.0.dylib*  libchm.a         libchm.dylib@    libchm.la* 

wxWidgets 相对文件多很多

ls /usr/local/lib/wx/
config/   include/

接着编译和安装xchm,根据官方教程一步一步来,但由于aclocal没有跟随autoreconf一起安装,执行./configure会报错

Can't exec "aclocal": No such file or directory at /usr/local/Cellar/autoconf/2.72/share/autoconf/Autom4te/FileUtils.pm line 299.
autoreconf: error: aclocal failed with exit status: 2

解决方案是brew install automake,安装完成后就可以继续了。如果编译过程提示找不到文件,比如:

checking for chm_lib.h... no
configure: error: Can't find the CHMLIB header.

执行./configure 的时候,添加参数,比如

./configure CPPFLAGS="-I./src" LDFLAGS="-L./src" && make
# 等待完成
make install

参考

  1. https://stackoverflow.com/questions/76852766/error-cant-exec-aclocal-with-homebrew-installed-autoreconf-on-mac
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容