I am on Linux system and was using nim 1.6.10. I upgraded to Nim 2.0 today. On compiling my nim program I get this Error
nim c "ValData_Validation_2023.nim" (in directory: /home/ajayc/Documents/Valuation/Asian/2023/WorkSpace) Error: cannot open '/usr/lib/nim/lib/system.nim' Compilation failed.
I have checked and there is no folder /usr/lib/nim/lib but system.nim file existe in /usr/lib/nim folder.
How do I tackle this issue?
ajay
Try running nim with specifying lib PATH: nim --lib:/usr/lib/nim ... .
If that works, you or the package maintainer probably overwritten this config option with wrong directory.
Check nim's config files for "/usr/lib/nim/lib"; list all active configs with nim --hints:on command while in your project's directory.
It's also would be helpful to know:
Thanks. I am using EndeavourOS latest version. I used "sudo pacman -Syu nim" to update nim application.
I tried running nim with "nim --lib:/usr/lib/nim c file.nim" and it works.
I did not clearly understood your second comment. I have removed nim completely and then reinstalled but the folder /usr/lib/nim/lib does not exist/get created.
I also tried running like this. "nim --hints:on --hint:Conf:on c file.nim" but I get the same error.
Then I tried this one
nim --lib:/usr/lib/nim --hints:on --hint:Conf:on c "ValData_Validation_2023.nim" (in directory: /home/ajayc/Documents/Valuation/Asian/2023/WorkSpace)
Hint: used config file '''/etc/nim/nim.cfg''' [Conf]
Hint: used config file '''/etc/nim/config.nims''' [Conf]
Compilation finished successfully.
I have checked the above two files but did not find any mention of /usr/lib/nim/lib folder
ajay
Related: https://github.com/nim-lang/Nim/issues/22369
@ajaychat3, as a temporary workaround you can add this line to '/etc/nim/nim.cfg':
--lib:"/usr/lib/nim"