emacs-rime icon indicating copy to clipboard operation
emacs-rime copied to clipboard

[BUG][Windows] librime-emacs.dll 在默认的makefile下windows平台无法编译通过

Open Yatogaii opened this issue 1 year ago • 1 comments

问题描述

使用scoop安装emacs,librime,官网安装器安装小狼毫。 使用straight包管理器(doom)安装完毕rime后,进入emacs执行 rime-compile-module 报错 Compile Rime dynamic module failedshell-command-output 信息如下:

gcc lib.c -o librime-emacs.dll -fPIC -O2 -Wall -I C:\Scoop\apps\librime\current\include/ -I c:/Scoop/apps/emacs/current/include/ -shared -L C:\Scoop\apps\librime\current\lib/ -Wl,-rpath C:\Scoop\apps\librime\current\lib/ -lrime
process_begin: CreateProcess(NULL, gcc lib.c -o librime-emacs.dll -fPIC -O2 -Wall -I C:\Scoop\apps\librime\current\include/ -I c:/Scoop/apps/emacs/current/include/ -shared -L C:\Scoop\apps\librime\current\lib/ -Wl,-rpath C:\Scoop\apps\librime\current\lib/ -lrime, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:40: lib] Error 2

把这一个命令放到PowerShell里执行报错是 -Wl,rpath 这里有问题,手动删掉这一部分后能正常编译出 librime-emacs.dll 文件。

之后尝试手动修改makefile,但是修改完makefile之后进入emacs仍然编译失败,看了看日志是修改的makefile没有生效,不知道为什么。

请问有什么办法解决吗?

Emacs中的配置

(use-package rime
  :custom
  (default-input-method "rime"))

复现方式(安装遇到问题时省略)

复现问题所需的操作

是否可在 emacs -Q 中复现

是/否

截图

image

环境信息

  • 操作系统:windows11
  • Emacs版本:29.1
  • Librime版本:1.8.5-1
  • Librime安装方式:Scoop
  • 安装方式:Straight(doom)

Yatogaii avatar Dec 22 '23 02:12 Yatogaii

Update: 使用powershell手动在 ~/.emacs.d/.local/straight/build/emacs-29.1/rime 这个路径里面编译出来 librime-emacs.dll 可以跳过在emacs里编译dll这一步,能正常用了。

但是仍然不知道这算不算是一个需要修复的BUG。

Yatogaii avatar Dec 22 '23 10:12 Yatogaii