问题
error: failed to run custom build command for onig_sys v61.1.0
I am compiling the rust program https://github.com/trishume/syntect by running make packs
. However it throws the error:
$ make packs
cargo run --example gendata -- synpack testdata/Packages assets/default_newlines.packdump assets/default_nonewlines.packdump
Compiling onig_sys v61.1.0
error: failed to run custom build command for `onig_sys v61.1.0`
process didn't exit successfully: `D:\syntect\target\debug\build\onig_sys-523c993a9ee13532\build-script-build` (exit code: 101)
...
--- stderr
DIST_NAME: onig
DIST_VERSION: 6.1.1
DIST_LICENSE: BSD
DIST_AUTHOR: K.Kosako
DIST_MAINTAINER: K.Kosako
DIST_URL: https://github.com/kkos/oniguruma
DIST_DESC: Oniguruma is a regular expressions library.
DIST_DEPENDS:
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1
build script failed, must exit now', C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.21\src\lib.rs:605
note: Run with `RUST_BACKTRACE=1` for a backtrace.
make: *** [packs] Error 101
Why the https://github.com/kkos/oniguruma is not compiling?
I ran cargo build -vv
and got this most all the log:
D:\syntect>cargo build -vv
Fresh num-traits v0.1.37
Fresh winapi-build v0.1.1
Fresh pkg-config v0.3.9
Fresh gcc v0.3.45
Fresh regex-syntax v0.4.0
Fresh num-integer v0.1.33
Fresh cmake v0.1.21
Fresh num-iter v0.1.33
Fresh lazy_static v0.2.4
Fresh winapi v0.2.8
Fresh yaml-rust v0.3.5
Fresh serde v0.8.23
Fresh bitflags v0.7.0
Fresh num v0.1.37
Fresh xml-rs v0.3.6
Fresh rustc-serialize v0.3.23
Fresh bitflags v0.8.0
Fresh fnv v1.0.5
Fresh serde v0.9.11
Fresh kernel32-sys v0.2.2
Fresh byteorder v1.0.0
Fresh bincode v0.6.1
Compiling onig_sys v61.1.0
Fresh same-file v0.1.3
Fresh libc v0.2.21
Running `D:\syntect\target\debug\build\onig_sys-523c993a9ee13532\build-scrip
t-build`
Fresh byteorder v0.5.3
Fresh walkdir v1.0.7
Fresh miniz-sys v0.1.9
Fresh time v0.1.36
Fresh flate2 v0.2.17
Fresh chrono v0.2.25
Fresh plist v0.1.2
running: "cmake" "C:\\Users\\Professional\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\onig_sys-61.1.0\\oniguruma" "-G" "Visual Studio 14 2015 Win64" "-DBUILD_SHARED_LIBS=OFF" "-
DCMAKE_INSTALL_PREFIX=D:\\syntect\\target\\debug\\build\\onig_sys-d633e
4c1e0d45051\\out" "-DCMAKE_C_FLAGS= /nologo /MD" "-DCMAKE_C_FLAGS_RELEASE= /nologo /MD" "-DCMAKE_CXX_FLAGS= /nologo /MD" "-DCMAKE_CXX_FLAGS_RELEASE= /nologo /MD" "-DCMAKE_BUILD_TYPE=Rele
ase"
DIST_NAME: onig
DIST_VERSION: 6.1.1
DIST_LICENSE: BSD
DIST_AUTHOR: K.Kosako
DIST_MAINTAINER: K.Kosako
DIST_URL: https://github.com/kkos/oniguruma
DIST_DESC: Oniguruma is a regular expressions library.
DIST_DEPENDS:
-- Configuring done
-- Generating done
-- Build files have been written to: D:/syntect/target/debug/build/onig_sys-d633e
4c1e0d45051/out/build
running: "cmake" "--build" "." "--target" "install" "--config" "Release" "--"
Microsoft (R) Build Engine version 14.0.24723.2
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 17/03/2017 15:41:57.
The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (186,61)" does not exist in the p
roject, and will be ignored.
The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (186,61)" does not exist in the p
roject, and will be ignored.
Project "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\instal
l.vcxproj" on node 1 (default targets).
Project "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\instal
l.vcxproj" (1) is building "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d450
51\out\build\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
InitializeBuildStatus:
Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
All outputs are up-to-date.
Checking Build System
CMake does not need to re-run because D:/syntect/target/debug/build/onig_sys-d6
33e4c1e0d45051/out/build/CMakeFiles/generate.stamp is up-to-date.
FinalizeBuildStatus:
Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Done Building Project "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\ou
t\build\ZERO_CHECK.vcxproj" (default targets).
The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (186,61)" does not exist in the p
roject, and will be ignored.
The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (186,61)" does not exist in the p
roject, and will be ignored.
Project "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\instal
l.vcxproj" (1) is building "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d450
51\out\build\ALL_BUILD.vcxproj" (3) on node 1 (default targets).
Project "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\ALL_BU
ILD.vcxproj" (3) is building "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d4
5051\out\build\onig.vcxproj" (4) on node 1 (default targets).
InitializeBuildStatus:
Touching "onig.dir\Release\onig.tlog\unsuccessfulbuild".
CustomBuild:
All outputs are up-to-date.
Building Custom Rule C:/Users/user/.cargo/registry/src/github.com-1ecc6299db9ec823/onig_sys-61.1.0/oniguruma/CMakeLists.txt
CMake does not need to re-run because D:/syntect/target/debug/build/onig_sys-d6
33e4c1e0d45051/out/build/CMakeFiles/generate.stamp is up-to-date.
ClCompile:
F:\VisualStudio2015\VC\bin\x86_amd64\CL.exe /c /I"D:\syntect\target\debug\build
\onig_sys-d633e4c1e0d45051\out\build" /I"C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma" /nologo /W1 /WX- /O2 /D _CRT_SECURE_NO_WARNINGS
/D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"onig.dir\Release\\" /Fd"onig.dir\Release\onig.pdb" /Gd /TC /errorReport:queue "C:\
Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c"
regenc.c
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(32): warning C4273: 'OnigEncDefaultCharEncoding': inconsistent dll linkage [D
:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.h(227): note: see previous definition of 'OnigEncDefaultCharEncoding'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(32): error C2099: initializer is not a constant [D:\User\\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(36): warning C4273: 'onigenc_init': inconsistent dll linkage [D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(343): note: see previous definition of 'onigenc_init'
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(345): note: see previous definition of 'onig_initialize_encoding'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(53): warning C4273: 'onigenc_get_default_encoding': inconsistent dll linkage
[D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(349): note: see previous definition of 'onigenc_get_default_encoding'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(59): warning C4273: 'onigenc_set_default_encoding': inconsistent dll linkage
[D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(347): note: see previous definition of 'onigenc_set_default_encoding'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(66): warning C4273: 'onigenc_get_right_adjust_char_head': inconsistent dll li
nkage [D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcx
proj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(359): note: see previous definition of 'onigenc_get_right_adjust_char_he
ad'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(77): warning C4273: 'onigenc_get_right_adjust_char_head_with_prev': inconsist
ent dll linkage [D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\buil
d\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(353): note: see previous definition of 'onigenc_get_right_adjust_char_he
ad_with_prev'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(92): warning C4273: 'onigenc_get_prev_char_head': inconsistent dll linkage [D
:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(355): note: see previous definition of 'onigenc_get_prev_char_head'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(101): warning C4273: 'onigenc_step_back': inconsistent dll linkage [D:\User\D
ropbox\Applications\SoftwareVersioning\SublimeText\Data\Packages\ObjectBeautifier\source\libraries\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(338): note: see previous definition of 'onigenc_step_back'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(127): warning C4273: 'onigenc_step': inconsistent dll linkage [D:\User\Dropbo
x\Applications\SoftwareVersioning\SublimeText\Data\Packages\ObjectBeautifier\source\libraries\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.h(222): note: see previous definition of 'onigenc_step'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(137): warning C4273: 'onigenc_strlen': inconsistent dll linkage [D:\User\Drop
box\Applications\SoftwareVersioning\SublimeText\Data\Packages\ObjectBeautifier\source\libraries\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(361): note: see previous definition of 'onigenc_strlen'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(150): warning C4273: 'onigenc_strlen_null': inconsistent dll linkage [D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(363): note: see previous definition of 'onigenc_strlen_null'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(175): warning C4273: 'onigenc_str_bytelen_null': inconsistent dll linkage [D:
\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(365): note: see previous definition of 'onigenc_str_bytelen_null'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(197): warning C4273: 'OnigEncAsciiToLowerCaseTable': inconsistent dll linkage
[D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.h(228): note: see previous definition of 'OnigEncAsciiToLowerCaseTable'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(269): warning C4273: 'OnigEncAsciiCtypeTable': inconsistent dll linkage [D:\U
ser\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.h(230): note: see previous definition of 'OnigEncAsciiCtypeTable'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(304): warning C4273: 'OnigEncISO_8859_1_ToLowerCaseTable': inconsistent dll l
inkage [D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vc
xproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.h(216): note: see previous definition of 'OnigEncISO_8859_1_ToLowerCaseTable'
"D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\install.vcxpro
j" (default target) (1) ->
"D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\ALL_BUILD.vcxp
roj" (default target) (3) ->
"D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj"
(default target) (4) ->
(ClCompile target) ->
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(32): error C2099: initializer is not a constant [D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
45 Warning(s)
1 Error(s)
Time Elapsed 00:00:03.85
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1
build script failed, must exit now', C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.21\src\lib.rs:605
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: failed to run custom build command for `onig_sys v61.1.0`
process didn't exit successfully: `D:\syntect\target\debug\build\onig_sys-523c993
a9ee13532\build-script-build` (exit code: 101)
--- stdout
running: "cmake" "C:\\Users\\Professional\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\onig_sys-61.1.0\\oniguruma" "-G" "Visual Studio 14 2015 Win64" "-DBUILD_SHARED_LIBS=OFF" "-
DCMAKE_INSTALL_PREFIX=D:\\User\\syntect\\target\\debug\\build\\onig_sys-d633e
4c1e0d45051\\out" "-DCMAKE_C_FLAGS= /nologo /MD" "-DCMAKE_C_FLAGS_RELEASE= /nologo /MD" "-DCMAKE_CXX_FLAGS= /nologo /MD" "-DCMAKE_CXX_FLAGS_RELEASE= /nologo /MD" "-DCMAKE_BUILD_TYPE=Rele
ase"
-- Configuring done
-- Generating done
-- Build files have been written to: D:/syntect/target/debug/build/onig_sys-d633e
4c1e0d45051/out/build
running: "cmake" "--build" "." "--target" "install" "--config" "Release" "--"
Microsoft (R) Build Engine version 14.0.24723.2
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 17/03/2017 15:41:57.
The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (186,61)" does not exist in the p
roject, and will be ignored.
The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (186,61)" does not exist in the p
roject, and will be ignored.
Project "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\instal
l.vcxproj" on node 1 (default targets).
Project "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\instal
l.vcxproj" (1) is building "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d450
51\out\build\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
InitializeBuildStatus:
Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
All outputs are up-to-date.
Checking Build System
CMake does not need to re-run because D:/syntect/target/debug/build/onig_sys-d6
33e4c1e0d45051/out/build/CMakeFiles/generate.stamp is up-to-date.
FinalizeBuildStatus:
Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Done Building Project "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\ou
t\build\ZERO_CHECK.vcxproj" (default targets).
The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (186,61)" does not exist in the p
roject, and will be ignored.
The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (186,61)" does not exist in the p
roject, and will be ignored.
Project "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\instal
l.vcxproj" (1) is building "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d450
51\out\build\ALL_BUILD.vcxproj" (3) on node 1 (default targets).
Project "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\ALL_BU
ILD.vcxproj" (3) is building "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d4
5051\out\build\onig.vcxproj" (4) on node 1 (default targets).
InitializeBuildStatus:
Touching "onig.dir\Release\onig.tlog\unsuccessfulbuild".
CustomBuild:
All outputs are up-to-date.
Building Custom Rule C:/Users/user/.cargo/registry/src/github.com-1ecc6299db9ec823/onig_sys-61.1.0/oniguruma/CMakeLists.txt
CMake does not need to re-run because D:/syntect/target/debug/build/onig_sys-d6
33e4c1e0d45051/out/build/CMakeFiles/generate.stamp is up-to-date.
ClCompile:
F:\VisualStudio2015\VC\bin\x86_amd64\CL.exe /c /I"D:\syntect\target\debug\build
\onig_sys-d633e4c1e0d45051\out\build" /I"C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma" /nologo /W1 /WX- /O2 /D _CRT_SECURE_NO_WARNINGS
/D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"onig.dir\Release\\" /Fd"onig.dir\Release\onig.pdb" /Gd /TC /errorReport:queue "C:\
Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c"
regenc.c
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(32): warning C4273: 'OnigEncDefaultCharEncoding': inconsistent dll linkage [D
:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.h(227): note: see previous definition of 'OnigEncDefaultCharEncoding'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(32): error C2099: initializer is not a constant [D:\User\\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(36): warning C4273: 'onigenc_init': inconsistent dll linkage [D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(343): note: see previous definition of 'onigenc_init'
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(345): note: see previous definition of 'onig_initialize_encoding'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(53): warning C4273: 'onigenc_get_default_encoding': inconsistent dll linkage
[D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(349): note: see previous definition of 'onigenc_get_default_encoding'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(59): warning C4273: 'onigenc_set_default_encoding': inconsistent dll linkage
[D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(347): note: see previous definition of 'onigenc_set_default_encoding'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(66): warning C4273: 'onigenc_get_right_adjust_char_head': inconsistent dll li
nkage [D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcx
proj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(359): note: see previous definition of 'onigenc_get_right_adjust_char_he
ad'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(77): warning C4273: 'onigenc_get_right_adjust_char_head_with_prev': inconsist
ent dll linkage [D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\buil
d\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\oniguruma.h(353): note: see previous definition of 'onigenc_get_right_adjust_char_he
ad_with_prev'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(861): warning C4273: 'onigenc_mb4_is_code_ctype': inconsistent dll linkage [D
:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.h(149): note: see previous definition of 'onigenc_mb4_is_code_ctype'
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(876): warning C4273: 'onigenc_with_ascii_strncmp': inconsistent dll linkage [
D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
c:\users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.h(220): note: see previous definition of 'onigenc_with_ascii_strncmp'
Done Building Project "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\ou
t\build\onig.vcxproj" (default targets) -- FAILED.
Done Building Project "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\ou
t\build\ALL_BUILD.vcxproj" (default targets) -- FAILED.
Done Building Project "D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\ou
t\build\install.vcxproj" (default targets) -- FAILED.
Build FAILED.
"D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\install.vcxpro
j" (default target) (1) ->
"D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\ALL_BUILD.vcxp
roj" (default target) (3) ->
"D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj"
(default target) (4) ->
(ClCompile target) ->
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(32): warning C4273: 'OnigEncDefaultCharEncoding': inconsistent dll linkage
[D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(861): warning C4273: 'onigenc_mb4_is_code_ctype': inconsistent dll linkage
[D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(876): warning C4273: 'onigenc_with_ascii_strncmp': inconsistent dll linkage
[D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
"D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\install.vcxpro
j" (default target) (1) ->
"D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\ALL_BUILD.vcxp
roj" (default target) (3) ->
"D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj"
(default target) (4) ->
(ClCompile target) ->
C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\onig_sys-61.1.0\oniguruma\src\regenc.c(32): error C2099: initializer is not a constant [D:\syntect\target\debug\build\onig_sys-d633e4c1e0d45051\out\build\onig.vcxproj]
45 Warning(s)
1 Error(s)
Time Elapsed 00:00:03.85
--- stderr
DIST_NAME: onig
DIST_VERSION: 6.1.1
DIST_LICENSE: BSD
DIST_AUTHOR: K.Kosako
DIST_MAINTAINER: K.Kosako
DIST_URL: https://github.com/kkos/oniguruma
DIST_DESC: Oniguruma is a regular expressions library.
DIST_DEPENDS:
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1
build script failed, must exit now', C:\Users\User\.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.21\src\lib.rs:605
note: Run with `RUST_BACKTRACE=1` for a backtrace.
D:\syntect>
回答1:
Oniguruma doesn't build with CMake on Windows MSVC. This was an open issue in the onig_sys
crate.
I've now updated the way the onig_sys crate builds so it should work with MSVC now.
To update to this fixed version make sure the Cargo.toml
dependency for onig
is set to either 1.2
or 1.2.1
:
[dependencies]
onig = "1.2"
来源:https://stackoverflow.com/questions/42864924/error-failed-to-run-custom-build-command-for-onig-sys-v61-1-0