'unresolved reference error for callable in another Kotlin file

I'm new in Kotlin (came from Python) and I'm trying to recreate a tic-tac-toe game.

I'm trying to use a class from another file but i just get this error when i compile the main file:

main.kt:2:21: error: unresolved reference: TicTacToeBoard
    var tabuleiro = TicTacToeBoard()
                    ^

In the directory, called "tictactoe", i have the "main.kt" and "board.kt" files:

The "main.kt" file:

fun main(args: Array<String>) {
    var tabuleiro = TicTacToeBoard()
}

The "board.kt" file:

class TicTacToeBoard

directory with two files and error

The same happens with functions from another file.

I've seen a lot of articles and videos where this same syntax work. What am i missing? why is this not working? and how can i use classes from another file on the main file?

EDIT 1: (more information)

I'm using VSCODE and running the file with the code runner extension on default settings.

kotlin information: Kotlin version 1.6.21-release-334 (JRE 18.0.1.1+2-6)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source