Open lindeer opened 1 month ago
msys: msys2-base-x86_64-20240507 gcc: 13.2.0 cmake: 3.30.0-rc4
$ cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release .. $ cmake --build build --config Release --target Dictionaries [ 57%] Linking CXX shared library msys-opencc-1.1.dll [ 57%] Built target libopencc [ 59%] Building CXX object src/tools/CMakeFiles/opencc_dict.dir/DictConverter.cpp.o [ 61%] Linking CXX executable opencc_dict.exe [ 61%] Built target opencc_dict [ 62%] Building STCharacters.ocd2 D:/workspace/opencc-dart/src/build/src/tools/opencc_dict.exe: error while loading shared libraries: msys-opencc-1.1.dll: cannot open shared object file: No such file or directory make[3]: *** [data/CMakeFiles/Dictionaries.dir/build.make:124: data/STCharacters.ocd2] Error 127 make[2]: *** [CMakeFiles/Makefile2:1081: data/CMakeFiles/Dictionaries.dir/all] Error 2 make[1]: *** [CMakeFiles/Makefile2:1088: data/CMakeFiles/Dictionaries.dir/rule] Error 2 make: *** [Makefile:628: Dictionaries] Error 2
在生成STCharacters.ocd2文件时失败了,但.dll文件已经生成,似乎是加载.dll文件时路径存在错误?
STCharacters.ocd2
如果将target从Dictionaries改为opencc时,则报:
Dictionaries
opencc
[ 30%] Built target marisa [ 93%] Built target libopencc [ 96%] Building CXX object src/tools/CMakeFiles/opencc.dir/CommandLine.cpp.o /d/workspace/opencc-dart/src/src/tools/CommandLine.cpp: In function ‘void Convert(std::string)’: /d/workspace/opencc-dart/src/src/tools/CommandLine.cpp:108:14: error: ‘mkstemp’ was not declared in this scope; did you mean ‘mkdtemp’? 108 | int fd = mkstemp(const_cast<char*>(tempFileName.c_str())); | ^~~~~~~ | mkdtemp make[3]: *** [src/tools/CMakeFiles/opencc.dir/build.make:76: src/tools/CMakeFiles/opencc.dir/CommandLine.cpp.o] Error 1 make[2]: *** [CMakeFiles/Makefile2:1001: src/tools/CMakeFiles/opencc.dir/all] Error 2 make[1]: *** [CMakeFiles/Makefile2:1008: src/tools/CMakeFiles/opencc.dir/rule] Error 2 make: *** [Makefile:589: opencc] Error 2
编译环境似乎被识别成Linux了,出现了linux上的mkstemp
mkstemp
msys: msys2-base-x86_64-20240507 gcc: 13.2.0 cmake: 3.30.0-rc4
在生成
STCharacters.ocd2
文件时失败了,但.dll文件已经生成,似乎是加载.dll文件时路径存在错误?如果将target从
Dictionaries
改为opencc
时,则报:编译环境似乎被识别成Linux了,出现了linux上的
mkstemp