1
Hello Worldの例をscala native(MacOS 10.11.6)に構築しようとしていますが、リンク中に次のエラーが発生します。 _scalanative_allocと_scalanative_initはどこで定義する必要がありますか?私のメインプログラムでは?もしそうなら、それを何と定義するべきですか?Scalaのネイティブhello worldが_scalanative_allocを見つけられません
[info] /Users/nnovod/tools/clang+llvm-4.0.0-x86_64-apple-darwin/bin/clang++
[info] -o
[info] /Users/nnovod/projects/scalaNative/target/scala-2.11/scalanative-out
[info] -lgc
[info] -I/usr/local/include
[info] -I/Users/nnovod/tools/clang+llvm-4.0.0-x86_64-apple-darwin/include
[info] -L/usr/local/lib
[info] -L/Users/nnovod/tools/clang+llvm-4.0.0-x86_64-apple-darwin/lib
[info] -target
[info] x86_64-apple-macosx10.11.0
...
[info] /Users/nnovod/projects/scalaNative/target/scala-2.11/nativelib/wrap.c.o
[error] Undefined symbols for architecture x86_64:
[error] "_scalanative_alloc", referenced from:
[error] _example.Main$::load in example.ll.o
[error] _java.io.OutputStream::write_class.ssnr.ByteArray_i32_i32_unit in java.io.ll.o
[error] _java.io.OutputStreamWriter::writeImpl_class.java.nio.CharBuffer_unit in java.io.ll.o
[error] _java.io.PrintStream::flush_unit in java.io.ll.o
[error] _java.io.PrintStream::write_i32_unit in java.io.ll.o
[error] _java.io.PrintStream::java$io$PrintStream$$encoder$lzycompute_class.java.io.OutputStreamWriter in java.io.ll.o
[error] _java.io.PrintStream::write_class.ssnr.ByteArray_i32_i32_unit in java.io.ll.o
[error] ...
[error] "_scalanative_init", referenced from:
[error] _main in __main.ll.o
[error] ld: symbol(s) not found for architecture x86_64
[error] clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
[info] Compiling LLVM IR to native code (1422 ms)
[info] Total (5920 ms)
[info] running
[info] /Users/nnovod/projects/scalaNative/target/scala-2.11/scalanative-out
java.io.IOException: Cannot run program "/Users/nnovod/projects/scalaNative/target/scala-2.11/scalanative-out": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
[trace] Stack trace suppressed: run last *:run for the full output.
[error] (*:run) java.io.IOException: Cannot run program "/Users/nnovod/projects/scalaNative/target/scala-2.11/scalanative-out": error=2, No such file or directory
[error] Total time: 6 s, completed Apr 5, 2017 10:40:54 AM