简体   繁体   中英

ghc does not work because of missing “Rts.h”

When I try to compile a Haskell program using ghc, it always raises the same exception: (translated to English)

$ ghc vtzr.hs
Linking vtzr ...

/tmp/ghc8101_0/ghc8101_0.c:1:17:
     fatal Error: Rts.h: File or directory not found
Compilation aborted.

Actually, the "Rts.h" is located properly at /usr/lib64/ghc-7.4.2/include so I do not really understand what the compiler complains about. I examined it a little further and found out that the exception actually comes from gcc trying to compile a tmp-file which includes Rts.h:

*** C Compiler:
'/usr/bin/gcc' '-fno-stack-protector' '-Wl,--hash-size=31' '-Wl,--reduce-memory-overheads' '-c' '/tmp/ghc8656_0/ghc8656_0.c' '-o' '/tmp/ghc8656_0/ghc8656_0.o' '-DTABLES_NEXT_TO_CODE' '-I' '-I/usr/lib64/ghc-7.4.2/include'

I am using ghc 7.4.2 and gcc 4.7.2 on Mageia 3 Linux x86_64. Maybe it is just a Mageia issue...? BTW. Running the program with runghc works fine.

好的,这似乎是Mageia版本的ghc的问题,或者是最新发行版中已修复的ghc 7.4.2错误:我刚刚从源代码构建了ghc 7.6.3,并且工作正常。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM