nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.49k stars 1.46k forks source link

Could not load: libnimhcr.so when compiling examples from hcr guide (Arch) #21691

Open demetera opened 1 year ago

demetera commented 1 year ago

Description

Example from https://nim-lang.org/docs/hcr.html compiled with the switch -d:nimDebugDlOpen arg is okay, but running ./mymain throws the EM.

Nim Version

demetera@demeterapc ~/P/N/hcr> nim -v
Nim Compiler Version 1.6.12 [Linux: amd64]
Compiled at 2023-03-10
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 1aa9273640c0c51486cf3a7b67282fe58f360e91
active boot switches: -d:release

Current Output

libnimhcr.so: cannot open shared object file: No such file or directory
could not load: libnimhcr.so

Expected Output

No response

Possible Solution

No response

Additional Information

I didn't find libnimhcr.so on my system nowhere. I was looking on the same issue before, found at least one of them closed: #13999

miguelmartin75 commented 10 months ago

Look under the "Native code targets" in the tutorial, you need to compile nimhcr and nimrtl runtimes

nim c --outdir:$PWD ~/.choosenim/toolchains/nim-#devel/lib/nimhcr.nim
nim c --outdir:$PWD ~/.choosenim/toolchains/nim-#devel/lib/nimrtl.nim

I cloned nim and compiled via source, you can change the choosenim dir to where you have nim