你如果用 msys2 的话,直接安装用 msys2-build.sh 编译就ok了,一分钟都花不了
readme上Windows部分是不是缺少了添加环境变量的部分。在我这里 liberime-core.dll
不在环境变量里的话emacs是找不到的。
liberime-core.dll
是动态模块,我用下面这个函数来找它的位置
(defun liberime-get-module-file ()
"Return the path of liberime-core file."
(let ((file1 (concat (liberime-get-library-directory)
"build/liberime-core"
module-file-suffix))
(file2 (concat (file-name-directory
(or (executable-find "emacs")
"/usr/bin/emacs"))
"liberime-core" module-file-suffix)))
(or liberime-module-file
(when (file-exists-p file1) file1)
(when (file-exists-p file2) file2)
(locate-library "liberime-core")
(locate-file
(concat "liberime-core" module-file-suffix)
exec-path))))
这种情况的话,就直接设置 liberime-module-file 变量吧
设置的话能找到 librime-core.dll
但是会出现这个情况,好像还是要设置环境变量
嗯。。编译了native-comp之后直接启动 emacs.exe
会直接core,不知道和这个有没有关系。
还是先用环境变量解决吧
backtrace
file-name-directory(nil)
(concat (file-name-directory (executable-find "emacs")) "../share")
(expand-file-name (concat (file-name-directory (executable-find "emacs")) "../share"))
(list (expand-file-name (concat (file-name-directory (executable-find "emacs")) "../share")) "c:/" "d:/" "e:/" "f:/" "g:/")
(liberime-find-rime-data (list (expand-file-name (concat (file-name-directory (executable-find "emacs")) "../share")) "c:/" "d:/" "e:/" "f:/" "g:/") '("rime-data" "msys32/mingw32/share/rime-data" "msys64/mingw64/share/rime-data"))
(cond ((memql system-type ''gnu/linux) (liberime-find-rime-data '("/usr/share/local" "/usr/share"))) ((memql system-type ''darwin) "/Library/Input Methods/Squirrel.app/Contents/Share...") ((memql system-type ''windows-nt) (liberime-find-rime-data (list (expand-file-name (concat (file-name-directory (executable-find "emacs")) "../share")) "c:/" "d:/" "e:/" "f:/" "g:/") '("rime-data" "msys32/mingw32/share/rime-data" "msys64/mingw64/share/rime-data"))))
(or liberime-shared-data-dir (cond ((memql system-type ''gnu/linux) (liberime-find-rime-data '("/usr/share/local" "/usr/share"))) ((memql system-type ''darwin) "/Library/Input Methods/Squirrel.app/Contents/Share...") ((memql system-type ''windows-nt) (liberime-find-rime-data (list (expand-file-name (concat (file-name-directory ...) "../share")) "c:/" "d:/" "e:/" "f:/" "g:/") '("rime-data" "msys32/mingw32/share/rime-data" "msys64/mingw64/share/rime-data")))) (liberime-get-user-data-dir))
liberime-get-shared-data-dir()
(let ((shared-dir (liberime-get-shared-data-dir)) (user-dir (liberime-get-user-data-dir))) (message "Liberime: start with shared dir %S, user dir: %S" shared-dir user-dir) (liberime-start shared-dir user-dir) (if liberime-current-schema (progn (liberime-select-schema liberime-current-schema))) (run-hooks 'liberime-after-start-hook))
liberime--start()
(if (not (featurep 'liberime-core)) (if liberime-auto-build (liberime-build) (if (> (length liberime-message) 0) (progn (let ((buf (get-buffer-create "*liberime message*"))) (save-current-buffer (set-buffer buf) (erase-buffer) (insert liberime-message) (goto-char (point-min))) (pop-to-buffer buf))))) (liberime--start))
liberime-load()
编译不过去我才想用其他同学的dll的
我刚刚更新了一下 liberime , pull 试试
我前两天更新了 msys2-build.sh, 现在已经不编译 librime 了,直接用 msys2 提供的
已经能找到了
我前面用的确实是这里的预编译包 在liberime目录pull了以后,执行msys2-build之后报错
# ./msys2-build.sh
错误:
错误:未找到目标:mingw-w64-x86_64-liberime
错误:未找到目标:mingw-w64-x86_64-librime-data
错误:未找到目标:mingw-w64-x86_64-rime-double-pinyin
pacman -Syu
到这一步又出问题了:-<, libjsoncpp-22.dll这个是干啥的?
mingw-w64-x86_64-librime 的可选依赖
mingw-w64-x86_64-rime-data: Rime schema repository from plum
(20/29) 正在安装 mingw-w64-x86_64-liberime [#####################] 100%
(21/29) 正在安装 mingw-w64-x86_64-rime-luna-pinyin [#####################] 100%
(22/29) 正在安装 mingw-w64-x86_64-rime-cangjie [#####################] 100%
(23/29) 正在安装 mingw-w64-x86_64-rime-stroke [#####################] 100%
(24/29) 正在安装 mingw-w64-x86_64-rime-terra-p... [#####################] 100%
(25/29) 正在安装 mingw-w64-x86_64-rime-bopomofo [#####################] 100%
(26/29) 正在安装 mingw-w64-x86_64-rime-essay [#####################] 100%
(27/29) 正在安装 mingw-w64-x86_64-rime-prelude [#####################] 100%
(28/29) 正在安装 mingw-w64-x86_64-librime-data [#####################] 100%
(29/29) 正在安装 mingw-w64-x86_64-rime-double-... [#####################] 100%
########## Build and install liberime ##########
D:/msys64/mingw64/bin/cmake.exe: error while loading shared libraries: libjsoncpp-22.dll: cannot open shared object file: No such file or directory
我正好遇到过,可能是你的 msys2 部分升级导致的
我记得我当时 pacman -Su 升级结束后,就没这个问题了
这个命令巨坑,我升了两天都没升成功,还是算了
我上午更新了一下msys2 build, 你可以再试试
pyim 用 rime 的话,没法使用模糊音。是我个人的问题还是大家都是这样?