# Hello from Seoul!

**URL:** <https://openrndr.discourse.group/t/hello-from-seoul/503>\
**Category:** Introductions\
**Created:** [February 6, 2023, 2:33pm UTC](https://openrndr.discourse.group/t/hello-from-seoul/503 "2023-02-06T14:33:43Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![icq4ever](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/icq4ever/32/472_2.png) [@icq4ever](https://openrndr.discourse.group/u/icq4ever)\
**Post date:** [February 8, 2023, 7:42am UTC](https://openrndr.discourse.group/t/hello-from-seoul/503/21 "2023-02-08T07:42:58Z")

</div>

with updated `build.gradle.kts` works but not with folder.

for example, `/src/main/kotlin/example/Example01.kt`  
I got this message

```auto
$ ./gradlew run -Papplication=example.Example01        

e: org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during psi2ir
File being compiled: /Users/icq4ever/openRNDR/src/main/kotlin/example/Example01.kt
The root cause java.lang.IllegalStateException was thrown at: org.jetbrains.kotlin.ir.symbols.impl.IrBindablePublicSymbolBase.bind(IrPublicSymbolBase.kt:58)
        at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException(CodegenUtil.kt:239)
        at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException$default(CodegenUtil.kt:235)
        at org.jetbrains.kotlin.psi2ir.generators.DeclarationGenerator.generateMemberDeclaration(DeclarationGenerator.kt:78)
        at org.jetbrains.kotlin.psi2ir.generators.ModuleGenerator.generateSingleFile(ModuleGenerator.kt:67)
        at org.jetbrains.kotlin.psi2ir.generators.ModuleGenerator.generateModuleFragment(ModuleGenerator.kt:47)
        at org.jetbrains.kotlin.psi2ir.Psi2IrTranslator.generateModuleFragment(Psi2IrTranslator.kt:78)
        at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.convertToIr(JvmIrCodegenFactory.kt:146)
        at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.convertToIr$default(JvmIrCodegenFactory.kt:64)
        at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.generateModule(JvmIrCodegenFactory.kt:59)
        at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.compileCorrectFiles(KotlinCodegenFacade.java:35)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.generate(KotlinToJVMBytecodeCompiler.kt:331)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:123)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:58)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:170)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:92)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
        at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
        at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:434)
        at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:120)
        at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:357)
        at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally$default(IncrementalCompilerRunner.kt:299)
        at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:159)
        at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:80)
        at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:622)
        at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:100)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1713)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
        at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.IllegalStateException: IrSimpleFunctionPublicSymbolImpl for /main|4973935383742426313[0] is already bound: FUN name:main visibility:public modality:FINAL <> () returnType:<unbound IrClassPublicSymbolImpl>
        at org.jetbrains.kotlin.ir.symbols.impl.IrBindablePublicSymbolBase.bind(IrPublicSymbolBase.kt:58)
        at org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl.<init>(IrFunctionImpl.kt:99)
        at org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl.createFunction(IrFactoryImpl.kt:125)
        at org.jetbrains.kotlin.ir.declarations.IrFactory$DefaultImpls.createFunction$default(IrFactory.kt:91)
        at org.jetbrains.kotlin.ir.util.OverridesKt$declareSimpleFunctionWithOverrides$1.invoke(overrides.kt:25)
        at org.jetbrains.kotlin.ir.util.OverridesKt$declareSimpleFunctionWithOverrides$1.invoke(overrides.kt:23)
        at org.jetbrains.kotlin.ir.util.SymbolTable.declareSimpleFunction(SymbolTable.kt:1920)
        at org.jetbrains.kotlin.ir.util.OverridesKt.declareSimpleFunctionWithOverrides(overrides.kt:23)
        at org.jetbrains.kotlin.psi2ir.generators.FunctionGenerator.declareSimpleFunctionInner(FunctionGenerator.kt:92)
        at org.jetbrains.kotlin.psi2ir.generators.FunctionGenerator.access$declareSimpleFunctionInner(FunctionGenerator.kt:39)
        at org.jetbrains.kotlin.psi2ir.generators.FunctionGenerator.generateFunctionDeclaration(FunctionGenerator.kt:398)
        at org.jetbrains.kotlin.psi2ir.generators.FunctionGenerator.generateFunctionDeclaration$default(FunctionGenerator.kt:44)
        at org.jetbrains.kotlin.psi2ir.generators.DeclarationGenerator.generateMemberDeclaration(DeclarationGenerator.kt:49)
        ... 41 more

FAILURE: Build failed with an exception.
...

```

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [February 8, 2023, 8:22am UTC](https://openrndr.discourse.group/t/hello-from-seoul/503/22 "2023-02-08T08:22:02Z")

</div>

Does the first line of `Example01.kt` look like

```auto
package example

```

? For me it works.

```auto
cd src/main/kotlin
mkdir example
cp TemplateProgram.kt example/Example01.kt
vi example/Example01.kt
# make first line equal to `package example`, change color to GREEN
cd ../../../
./gradlew run -Papplication=example.Example01

```

How does `Example01.kt` look like?

---

<div class="post-metadata">

**Author:** ![icq4ever](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/icq4ever/32/472_2.png) [@icq4ever](https://openrndr.discourse.group/u/icq4ever)\
**Post date:** [February 8, 2023, 8:36am UTC](https://openrndr.discourse.group/t/hello-from-seoul/503/23 "2023-02-08T08:36:07Z")

</div>

hmm? just change the color GREEN and others are totally same.

```auto
import kotlin.math.cos
import kotlin.math.sin
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.loadFont
import org.openrndr.draw.loadImage
import org.openrndr.draw.tint

fun main() = application {
    configure {
        width = 768
        height = 576
    }

    program {
        val image = loadImage("data/images/pm5544.png")
        val font = loadFont("data/fonts/default.otf", 64.0)

        extend {
            drawer.drawStyle.colorMatrix = tint(ColorRGBa.WHITE.shade(0.2))
            drawer.image(image)

            drawer.fill = ColorRGBa.GREEN
            drawer.circle(
                    cos(seconds) * width / 2.0 + width / 2.0,
                    sin(0.5 * seconds) * height / 2.0 + height / 2.0,
                    140.0
            )

            drawer.fontMap = font
            drawer.fill = ColorRGBa.WHITE
            drawer.text("EX01", width / 2.0, height / 2.0)
        }
    }
}

```

I have no idea, what I missing ? 😕

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [February 8, 2023, 8:39am UTC](https://openrndr.discourse.group/t/hello-from-seoul/503/24 "2023-02-08T08:39:41Z")

</div>

You are missing the first line: `package example` 🙂

If the file was opened in Idea it would suggest you to fix that automatically.  
If the folder was `example/bla` then you would need `package example.bla` .

---

<div class="post-metadata">

**Author:** ![icq4ever](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/icq4ever/32/472_2.png) [@icq4ever](https://openrndr.discourse.group/u/icq4ever)\
**Post date:** [February 8, 2023, 8:42am UTC](https://openrndr.discourse.group/t/hello-from-seoul/503/25 "2023-02-08T08:42:45Z")

</div>

oh- I see. now it works!! 😃  
need to understand how kotlin/java works behind.  
thank you so much!

---

<div class="post-metadata">

**Author:** ![icq4ever](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/icq4ever/32/472_2.png) [@icq4ever](https://openrndr.discourse.group/u/icq4ever)\
**Post date:** [February 8, 2023, 8:46am UTC](https://openrndr.discourse.group/t/hello-from-seoul/503/26 "2023-02-08T08:46:09Z")

</div>

btw I upload vscode tasks.json to [repo](https://github.com/icq4ever/openrndr-vscode).  
still need to update how to run subfolder codes, build excutable binary. etc.

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [February 8, 2023, 8:46am UTC](https://openrndr.discourse.group/t/hello-from-seoul/503/27 "2023-02-08T08:46:52Z")

</div>

When you are comfortable with your setup it would be amazing if you could write a short post `Using OPENRNDR with vscode` (and you can edit the post any time if you want to improve it 🙂 ). Probably some users would like that 🙂

Great work! Thanks for sharing that repo!

---

<div class="post-metadata">

**Author:** ![icq4ever](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/icq4ever/32/472_2.png) [@icq4ever](https://openrndr.discourse.group/u/icq4ever)\
**Post date:** [February 8, 2023, 8:51am UTC](https://openrndr.discourse.group/t/hello-from-seoul/503/28 "2023-02-08T08:51:17Z")

</div>

sure 🙂 let me organizing properly.

[Previous page](https://openrndr.discourse.group/t/hello-from-seoul/503.md?page=1)
