美文网首页
macOS 编译 xchm

macOS 编译 xchm

作者: 千羽之城88 | 来源:发表于2024-10-11 15:05 被阅读0次

先看看编译后的程序:


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

相关文章

网友评论

      本文标题:macOS 编译 xchm

      本文链接:https://www.haomeiwen.com/subject/qiwgrjtx.html