libltp icon indicating copy to clipboard operation
libltp copied to clipboard

ltp-java编译出错

Open whh1009 opened this issue 2 years ago • 1 comments

我在使用ltp-java时编译报错

本地环境:Windows 11 专业版 版本:22621.1265

  • java 信息:
[D:\java\ltp\libltp\ltp-java]$ java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
  • cargo 信息:
[D:\java\ltp\libltp\ltp-java]$ cargo --version
cargo 1.68.1 (115f34552 2023-02-26)
  • gradle 信息:
[D:\java\ltp\libltp\ltp-java]$ gradle -v

------------------------------------------------------------
Gradle 8.0.2
------------------------------------------------------------

Build time:   2023-03-03 16:41:37 UTC
Revision:     7d6581558e226a580d91d399f7dfb9e3095c2b1d

Kotlin:       1.8.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          1.8.0_121 (Oracle Corporation 25.121-b13)
OS:           Windows 10 10.0 amd64

我从仓库中把整个项目clone下来,

  • 本地目录结构:
[D:\java\ltp\libltp\ltp-java]$ tree ./
卷 DATA 的文件夹 PATH 列表
卷序列号为 00000041 AE2A:AF4A
D:\JAVA\LTP\LIBLTP\LTP-JAVA
├─.gradle
│  ├─8.0.2
│  │  ├─checksums
│  │  ├─dependencies-accessors
│  │  ├─executionHistory
│  │  ├─fileChanges
│  │  ├─fileHashes
│  │  └─vcsMetadata
│  ├─buildOutputCleanup
│  └─vcs-1
├─build
│  ├─classes
│  │  └─java
│  │      ├─main
│  │      │  └─cn
│  │      │      └─edu
│  │      │          └─hit
│  │      │              └─ir
│  │      └─test
│  │          └─cn
│  │              └─edu
│  │                  └─hit
│  │                      └─ir
│  ├─generated
│  │  └─sources
│  │      ├─annotationProcessor
│  │      │  └─java
│  │      │      ├─main
│  │      │      └─test
│  │      └─headers
│  │          └─java
│  │              ├─main
│  │              └─test
│  ├─libs
│  ├─reports
│  │  └─tests
│  │      └─test
│  │          ├─classes
│  │          ├─css
│  │          ├─js
│  │          └─packages
│  ├─test-results
│  │  └─test
│  │      └─binary
│  └─tmp
│      ├─compileJava
│      ├─compileTestJava
│      ├─jar
│      └─test
├─gradle
│  └─wrapper
├─rust
│  └─src
└─src
    ├─main
    │  ├─java
    │  │  └─cn
    │  │      └─edu
    │  │          └─hit
    │  │              └─ir
    │  └─resources
    └─test
        ├─java
        │  └─cn
        │      └─edu
        │          └─hit
        │              └─ir
        └─resources

  • 执行脚本
D:\java\ltp\libltp>cd ltp-java/rust && make lib
cargo build --release
    Updating git repository `https://github.com/AlongWY/onnxruntime-rs.git`
    Updating crates.io index
   Compiling winapi v0.3.9
   Compiling proc-macro2 v1.0.54
   Compiling quote v1.0.26
   Compiling memchr v2.5.0
   Compiling libc v0.2.140
   Compiling windows_x86_64_msvc v0.42.2
   Compiling log v0.4.17
   Compiling syn v1.0.109
error: linker `link.exe` not found
  |
  = note: program not found

note: the msvc targets depend on the msvc linker but `link.exe` was not found

note: please ensure that Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option.

note: VS Code is a different product, and is not sufficient.

error: could not compile `windows_x86_64_msvc` due to previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `log` due to previous error
error: could not compile `quote` due to previous error
error: could not compile `memchr` due to previous error
error: could not compile `syn` due to previous error
error: could not compile `proc-macro2` due to previous error
error: could not compile `libc` due to previous error
error: could not compile `winapi` due to previous error
make: *** [lib] Error 101
D:\java\ltp\libltp\ltp-java\rust>cd .. && gradle build

> Task :test FAILED

LTPTest > test() FAILED
    java.lang.ExceptionInInitializerError at LTPTest.java:12
        Caused by: java.lang.NullPointerException at LTPTest.java:12

1 test completed, 1 failed

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///D:/java/ltp/libltp/ltp-java/build/reports/tests/test/index.html

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
4 actionable tasks: 1 executed, 3 up-to-date

我还在入门,不太懂这个,请帮忙看看。 谢谢 (^_^)

whh1009 avatar Mar 28 '23 06:03 whh1009

你可能需要安装msvc

AlongWY avatar Aug 17 '23 14:08 AlongWY