1

Following instruction here: https://kotlinlang.org/docs/tutorials/command-line-library-js.html but getting Invalid argument: -library-files when compiling. I am not sure where I did wrong. Any help appreciated.

Compiler obtained from https://github.com/JetBrains/kotlin/releases/tag/v1.1

kotlin-compiler-1.1.zip

kotlinc-js -output binom.js -library-files sample-library.jar binom.kt

Invalid argument: -library-files
Usage: kotlinc-js <options> <source files>
where possible options include:
  -output <path>             Output file path
  -no-stdlib                 Don't use bundled Kotlin stdlib
  -libraries <path>          Paths to Kotlin libraries with .meta.js and .kjsm files, separated by system file separator
  -source-map                Generate source map
  -meta-info                 Generate .meta.js and .kjsm files with metadata. Use to create a library
  -target { v5 }             Generate JS files for specific ECMA version
  -module-kind { plain, amd, commonjs, umd }
                         Kind of a module generated by compiler
  -main {call,noCall}        Whether a main function should be called
  -output-prefix <path>      Path to file which will be added to the beginning of output file
  -output-postfix <path>     Path to file which will be added to the end of output file
  -language-version <version> Provide source compatibility with specified language version
  -api-version <version>     Allow to use declarations only from the specified version of bundled libraries
  -nowarn                    Generate no warnings
  -verbose                   Enable verbose logging output
  -version                   Display compiler version
  -help (-h)                 Print a synopsis of standard options
  -X                         Print a synopsis of advanced options
  -P plugin:<pluginId>:<optionName>=<value>
                         Pass an option to a plugin

1 Answer 1

3

This option has been renamed to -libraries before JavaScript support has been released as a part of Kotlin 1.1. This part of the tutorial is not up-to-date yet, I'll fix it.

Sign up to request clarification or add additional context in comments.

1 Comment

Now get error with binom.kt: binom.kt:8:16: error: unresolved reference: forOdd (1..n).forOdd { result = result * it } ^ binom.kt:8:43: error: unresolved reference: it (1..n).forOdd { result = result * it }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.