Scala on .Net HelloWorld

Viewed 560

Following the README at https://github.com/magarciaEPFL/scaladotnet to create a Windows exe for a simple "Hello World" app:

package hello.world

object Main {
  def main(args: Array[String]) {
    println("Hello, World!")
  }
}

Built .exe with the command from the README:

scalacompiler.exe ^
-d C:\test\bin ^
-target:exe ^
-Ystruct-dispatch:no-cache ^
-Xassem-name HelloWorld.exe ^
-Xassem-extdirs C:\scala.net ^
-Xshow-class hello.world.Main ^
C:\test\src\HelloWorld.scala

While using Windows 7 Pro, 64bit, I receive this error when attempting a run:

C:\test\bin>HelloWorld.exe

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'scalalib, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. at Main(String[] args)

The Scala .Net compiler directory is directly in the path, yet it appears that the HelloWorld.exe is unable to find and load the scalalib.dll that is in that directory. As per the comments below, copying the HelloWorld.exe directly into the C:\scala.net directory, and executing from there, works as expected. But, placing the .exe into another directory, and the C:\scala.net dir as part of the PATH, does not.

What is wrong?

1 Answers
Related