jkbbwr
03/27/2018, 4:17 PMolonho
03/27/2018, 4:50 PMjkbbwr
03/27/2018, 5:28 PMSam
03/27/2018, 6:10 PMnapperley
03/28/2018, 9:55 PM/tmp/konan_temp1988559466143815551/combined.o:ld-temp.o:function Konan_start: error: undefined reference to 'EntryPointSelector'
error: could not find 'main' in '<root>' package.
This import causes the linker to fail: import newt.newtWinMenu
olonho
04/02/2018, 9:22 AMfun main(args: Array<String>)
in your program?napperley
04/02/2018, 9:39 AMpackage = newt
headers = popt.h newt.h newt_pr.h nls.h dialogboxes.h
compilerOpts = -std=c99
compilerOpts.linux = -I/home/napperley/newt-0.52.20 -I/usr/include
linkerOpts = -lpopt -lnewt
linkerOpts.linux = -L/home/napperley/newt-0.52.20 -L/usr/lib/x86_64-linux-gnu -lpopt -lnewt
olonho
04/02/2018, 10:22 AMalexander.gorshenev
04/02/2018, 10:36 AM./gradlew -i
log of the build.napperley
04/03/2018, 12:39 AMimport newt.newtInit
import newt.newtCls
import newt.newtFinished
import newt.newtWaitForKey
import newt.newtDrawRootText
import newt.newtWinMenu
import newt.newtWinMessage
import kotlinx.cinterop.*
fun main(args: Array<String>) = memScoped {
newtInit()
newtCls()
newtDrawRootText(0, 1, "Hello World! :)")
newtWinMessage(title = "Simple".cstr, text = "This is a simple message window".cstr,
buttonText = "Close".cstr)
val menuItems = arrayOf<CPointer<ByteVar>?>("Item 1".cstr.getPointer(this), "Item 2".cstr.getPointer(this))
newtWinMenu(
title = "Choices".cstr,
text = "Make your choice".cstr,
maxListHeight = 10,
suggestedWidth = 50,
button1 = "Select".cstr,
items = menuItems.toCValues().getPointer(this),
listItem = null,
flexUp = 3,
flexDown = 3
)
newtWaitForKey()
newtFinished()
}
$KOTLIN_NATIVE/bin/konanc -opt -library newt -o newt_demo newt_demo.kt
/tmp/konan_temp779856219315075082/combined.o:ld-temp.o:function Konan_start: error: undefined reference to 'EntryPointSelector'
error: could not find 'main' in '<root>' package.
error: /home/napperley/.konan/dependencies/target-gcc-toolchain-3-linux-x86-64/x86_64-unknown-linux-gnu/bin/ld.gold invocation reported errors
olonho
04/03/2018, 6:49 AMjkbbwr
04/03/2018, 11:56 AMolonho
04/03/2018, 12:35 PMnapperley
04/04/2018, 3:51 AMolonho
04/04/2018, 8:35 AMfun main(args: Array<String>): Unit = memScoped {
otheriwse your main
doesn’t match expected main signaturenapperley
04/04/2018, 11:26 PMfun main(args: Array<String>) = memScoped { ...
.olonho
04/05/2018, 5:29 AMnapperley
04/05/2018, 8:27 AMUnit
as the last line in the memScoped
block, but that would be a bit weird (not Kotlinic).