imfuxiao / Hamster

librime for iOS App
GNU General Public License v3.0
1.29k stars 80 forks source link

编译librimeKit 报错 #43

Closed Attiv closed 1 year ago

Attiv commented 1 year ago

能否留个联系方式?我感觉是环境配的有问题。

  1. sudo make boost-build 成功的,生成了 boost_1_80_0
  2. 按照/librime/readme-ios.md 把文件挪走 CleanShot 2023-04-16 at 17 27 00@2x CleanShot 2023-04-16 at 17 32 06@2x
  3. export BOOST_ROOT="/Users/wanglikun/iOSGithub/vitta/Hamster/Packages/LibrimeKit/librime/deps/boost"
  4. sudo make xcode/ios/deps 成功
  5. sudo make librime-buildsudo make xcode/ios 都报一样的错,报 lib 下的那几个模块没找到 CleanShot 2023-04-16 at 17 35 22@2x
imfuxiao commented 1 year ago

sudo make librime-build会调用librimeBuild.sh脚本,脚本中第425行: export BOOST_ROOT=$RIME_ROOT/.boost/dest 覆盖了你第3步指定的BOOST_ROOT

imfuxiao commented 1 year ago

应该只需要执行make相关命令, 其他应该不需要手动执行

Attiv commented 1 year ago

找到问题了,librimeBuild.sh 脚本中第 425 行: export BOOST_ROOT=$RIME_ROOT/.boost/dest 这个 ./boost/dest 没自动创建,要手动弄

flay0303 commented 1 year ago

我执行make boost-build就失败了。。 checking for x86_64-apple-darwin-cl.exe... no checking for x86_64-apple-darwin-icc... no checking for clang... clang configure: WARNING: using cross tools not prefixed with host triplet checking whether the C compiler works... no configure: error: in '/Users/awesome/Library/Caches/CocoaPods/Pods/Release/icu4c-iosx/72.1.1-bfcf8/icu4c-maint-maint-72-catalyst-arm64-build/source': configure: error: C compiler cannot create executables See 'config.log' for more details

config.log里的 `clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' [-Wmissing-sysroot] ld: library not found for -lc++ clang: error: linker command failed with exit code 1 (use -v to see invocation) configure:3099: $? = 1 configure:3137: result: no configure: failed program was: / confdefs.h / #define PACKAGE_NAME "ICU" #define PACKAGE_TARNAME "International Components for Unicode" #define PACKAGE_VERSION "72.1" #define PACKAGE_STRING "ICU 72.1" #define PACKAGE_BUGREPORT "http://icu-project.org/bugs" #define PACKAGE_URL "http://icu-project.org" / end confdefs.h. /
int
main ()
{
;
return 0;
}

configure:3142: error: in '/Users/awesome/Library/Caches/CocoaPods/Pods/Release/icu4c-iosx/72.1.1-bfcf8/icu4c-maint-maint-72-catalyst-arm64-build/source': configure:3144: error: C compiler cannot create executables See 'config.log' for more details`

这是缺库文件吗?

imfuxiao commented 1 year ago

找到问题了,librimeBuild.sh 脚本中第 425 行: export BOOST_ROOT=$RIME_ROOT/.boost/dest 这个 ./boost/dest 没自动创建,要手动弄

有的. 在425行的上面

# librime dependences build
if [[ ! -d ${RIME_ROOT}/.boost ]]
then
  mkdir ${RIME_ROOT}/.boost
  cp -R ${RIME_ROOT}/boost-iosx/dest ${RIME_ROOT}/.boost
fi
export BOOST_ROOT=$RIME_ROOT/.boost/dest
Attiv commented 1 year ago

我的这个不知道为啥没有生成,.boost 里的是空的。。。手动把 readme-ios.md 里说的步骤弄进去才成功的

Attiv commented 1 year ago

又遇到新问题了。。 CleanShot 2023-04-16 at 18 02 45@2x 这个文件夹仓库里没有,是需要自己生成的吗

imfuxiao commented 1 year ago

又遇到新问题了。。 CleanShot 2023-04-16 at 18 02 45@2x 这个文件夹仓库里没有,是需要自己生成的吗

通过Hamster根路径下的nputSchemaBuild.sh脚本, Makefile

schema:
    bash ./InputSchemaBuild.sh
imfuxiao commented 1 year ago

我执行make boost-build就失败了。。 checking for x86_64-apple-darwin-cl.exe... no checking for x86_64-apple-darwin-icc... no checking for clang... clang configure: WARNING: using cross tools not prefixed with host triplet checking whether the C compiler works... no configure: error: in '/Users/awesome/Library/Caches/CocoaPods/Pods/Release/icu4c-iosx/72.1.1-bfcf8/icu4c-maint-maint-72-catalyst-arm64-build/source': configure: error: C compiler cannot create executables See 'config.log' for more details

config.log里的 clang: warning: no such sysroot directory: '/Library/Developer/CommandLineTools/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' [-Wmissing-sysroot] ld: library not found for -lc++ clang: error: linker command failed with exit code 1 (use -v to see invocation) configure:3099: $? = 1 configure:3137: result: no configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "ICU" | #define PACKAGE_TARNAME "International Components for Unicode" | #define PACKAGE_VERSION "72.1" | #define PACKAGE_STRING "ICU 72.1" | #define PACKAGE_BUGREPORT "http://icu-project.org/bugs" | #define PACKAGE_URL "http://icu-project.org" | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:3142: error: in '/Users/awesome/Library/Caches/CocoaPods/Pods/Release/icu4c-iosx/72.1.1-bfcf8/icu4c-maint-maint-72-catalyst-arm64-build/source': configure:3144: error: C compiler cannot create executables See 'config.log' for more details

这是缺库文件吗?

文件应该不缺, 我理解还是开发环境的问题. xcode command line tools是否有安装? xcode-select --instal

flay0303 commented 1 year ago

文件应该不缺, 我理解还是开发环境的问题. xcode command line tools是否有安装? xcode-select --instal

已经装了几遍commandLine tools了,方便说下你用的xcode版本吗

Attiv commented 1 year ago

Resources 下没有 SharedSupport 的时候会报错: Resources/SharedSupport is not a directory

我这就是遇到这个错了。。

imfuxiao commented 1 year ago

文件应该不缺, 我理解还是开发环境的问题. xcode command line tools是否有安装? xcode-select --instal

已经装了几遍commandLine tools了,方便说下你用的xcode版本吗

我是最新的: Version 14.3 (14E222b)

imfuxiao commented 1 year ago

Resources 下没有 SharedSupport 的时候会报错: Resources/SharedSupport is not a directory

我这就是遇到这个错了。。

是Shell报错么?

Attiv commented 1 year ago

文件没复制过去

imfuxiao commented 1 year ago

我的问题, 忘记把SharedSupport建立了, 我改下Shell

Attiv commented 1 year ago

https://github.com/imfuxiao/Hamster/blob/main/Hamster/RimeEngine/RimeEngine.swift#L340 这里你们不报错吗?api里只有两个参数 CleanShot 2023-04-16 at 18 37 49@2x

imfuxiao commented 1 year ago

https://github.com/imfuxiao/Hamster/blob/main/Hamster/RimeEngine/RimeEngine.swift#L340 这里你们不报错吗?api里只有两个参数 CleanShot 2023-04-16 at 18 37 49@2x

重新同步下代码, 今天改bug时, 重新改了api, 刚提交了代码.

imfuxiao commented 1 year ago

Resources 下没有 SharedSupport 的时候会报错: Resources/SharedSupport is not a directory

我这就是遇到这个错了。。

shell 已修改