Cryptic error when running `cabal run` for the first time

I’ve been working on this project for the past few days, and I’ve finally hit cabal run to try it out, but I got this very very cryptic error message that I couldn’t decypher:

/home/theonlytails/IdeaProjects/aura_lang/dist-newstyle/build/x86_64-linux/ghc-8.10.7/aura-lang-0.1.0.0/x/aura-lang/build/aura-lang/aura-lang-tmp/Main.o(.text+0x74): error: undefined reference to 'aurazmlangzm0zi1zi0zi0zminplace_Syntax_zdfShowExpressionzuzdcshow_closure'

(something like that, repeating ~100 times)
Could anyone please help me figure it out? because I am lost.

(here’s the full log message: cabal.run.log · GitHub)

2 Likes

Hello TheOnlyTails, while I read the logs, can you run cabal clean and then cabal run again?

edit: I can reproduce this on my machine too

1 Like

Ok, you are missing some modules in `exposed-modules. Try this:

exposed-modules:
    Parser,
    Lexer,
    Syntax

Does it help?

I have opened a ticket to improve cabal UX regarding this.

2 Likes

That did the trick, thank you so much! I didn’t use either Lexer or Syntax outside of the src/ folder, so I guess I didn’t realize it was necessary to expose them.

2 Likes

Did not notice that, they should be listed in other-modules then!

2 Likes

I believe you can enable -Wmissing-home-modules to get a warning about this.

1 Like