- scala 2.11.x
- sbt 0.13.16
In your app directory run sbt to install all the dependencies
sbt
Add your compilation script in makefile file:
clang -m64 -c src/main/c/hello.c -o target/libhello.so
And in your scala file
import scalanative.native._
@extern
@link("hello")
object hello {
def greet(str: CString, n: CInt): CString = extern
} sbt compile sbt runAfter compiling, you can find the executable file in target/{SCALA_VERSION}/EXE
target/scala-2.11/scala-native-starter-outThe MIT License (MIT)