(求助)今天编译 emacs 报错:make faliure

不知道怎么应对…

/opt/homebrew/opt/gcc/include -I/opt/homebrew/opt/libgccjit/include   macfont.m
image.c:12358:12: error: call to undeclared function 'rsvg_handle_get_pixbuf_and_error'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 12358 |   pixbuf = rsvg_handle_get_pixbuf_and_error (rsvg_handle, &err);
       |            ^
image.c:12358:12: note: did you mean 'rsvg_handle_get_pixbuf_sub'?
/opt/homebrew/Cellar/librsvg/2.58.4/include/librsvg-2.0/librsvg/rsvg.h:661:12: note: 'rsvg_handle_get_pixbuf_sub' declared here
  661 | GdkPixbuf *rsvg_handle_get_pixbuf_sub (RsvgHandle *handle, const char *id);
      |            ^
image.c:12358:10: error: incompatible integer to pointer conversion assigning to 'GdkPixbuf *' (aka 'struct _GdkPixbuf *') from 'int' [-Wint-conversion]
 12358 |   pixbuf = rsvg_handle_get_pixbuf_and_error (rsvg_handle, &err);
       |          ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
gmake[2]: *** [Makefile:457: image.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: Leaving directory '/private/tmp/emacs-plusA31-20241206-95253-s7r354/src'
gmake[1]: *** [Makefile:554: src] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake[2]: Leaving directory '/private/tmp/emacs-plusA31-20241206-95253-s7r354/doc/lispref'
gmake[1]: Leaving directory '/private/tmp/emacs-plusA31-20241206-95253-s7r354'
gmake[1]: Entering directory '/private/tmp/emacs-plusA31-20241206-95253-s7r354'
***
*** "make all" failed with exit status 2.
***
*** You could try to:
*** - run "make bootstrap", which might fix the problem
*** - run "make V=1", which displays the full commands invoked by make,
***   to further investigate the problem
***
gmake[1]: *** [Makefile:418: advice-on-failure] Error 2
gmake[1]: Leaving directory '/private/tmp/emacs-plusA31-20241206-95253-s7r354'
gmake: *** [Makefile:374: all] Error 2

照他说的make bootstrap,还不行就把缓存请了再试试

试了,但因为是存放在临时文件夹,文件已经清除了,无法 make bootstrap

前几天编译也遇到了,我直接回退到了之前的 commit

原来是这样啊,请教一下怎么回退啊,这问题烦了我一个上午

git reset

需要安装 librsvg 2.59.x

brew 的才到 2.58.4,估计就是因为这个吧(

如果你用的是 emacs-plus 的话,就这样

1 个赞

是的. 从 2.58 到 2.59 变化比较大, 编译方式也有改变, 估计得需要些时间才会更新到 2.59

打开 src/image.c,找到这么一行:

#if LIBRSVG_CHECK_VERSION (2, 58, 0)

把其中的 58 改成 59 就行了。

1 个赞

好像有两个地方

是的,还有个 LOAD_DLL_FN 的地方,不过对 linux 没有影响。

就怎样? ​ ​ ​ ​

贴了链接了呀

链接我看到了,但我没明白「就这样」是什么意思。

楼上不知道怎么回退 commit,贴的链接是emacs-plus回退的。

哦,抱歉。我没认真看,以为只是单纯贴了项目主页的链接。

我的 librsvg 版本是 2.56.3,手动编译最新版 Emacs 没有遇到任何问题。

⋊> [~/s/b/emacs-nightly] ./src/emacs --version
GNU Emacs 31.0.50
Development version 9ddec89e422d on master-241206 branch; build date 2024-12-06.
Copyright (C) 2024 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

⋊> [~/s/b/emacs-nightly] rg '^RSVG_CFLAGS' config.log
59350:RSVG_CFLAGS='-isystem /opt/local/include/librsvg-2.0 -isystem /opt/local/include/gdk-pixbuf-2.0 -isystem /opt/local/include -isystem /opt/local/include/cairo -isystem /opt/local/include -isystem /opt/local/include/glib-2.0 -isystem /opt/local/lib/glib-2.0/include -isystem /opt/local/include -isystem /opt/local/include/pixman-1 -isystem /opt/local/include -isystem /opt/local/include/freetype2 -isystem /opt/local/include -isystem /opt/local/include/libpng16 -isystem /opt/local/include'

⋊> [~/s/b/emacs-nightly] cat /opt/local/include/librsvg-2.0/librsvg/rsvg-version.h
#if !defined (__RSVG_RSVG_H_INSIDE__) && !defined (RSVG_COMPILATION)
#warning "Including <librsvg/rsvg-version.h> directly is deprecated."
#endif

#ifndef RSVG_VERSION_H
#define RSVG_VERSION_H

#define LIBRSVG_MAJOR_VERSION (2)
#define LIBRSVG_MINOR_VERSION (56)
#define LIBRSVG_MICRO_VERSION (3)
#define LIBRSVG_VERSION "2.56.3"

#endif

https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-30&id=f65de1019dca6398097751abefcad7e1a4637551

1 个赞