• Uncategorized

About linux : llvmSupportTargetRegistryh-No-such-file-or-directory

Question Detail

I have this error when I make project in WSL(Ubuntu 20.04). And I have installed LLVM and Clang.Hou should I do?

Kconfig  Makefile  README.md  build  configs  include  resource  scripts  src  tools
why@YOGA:~/ics2021/nemu$ make
+ CXX src/utils/disasm.cc
src/utils/disasm.cc:5:10: fatal error: llvm/Support/TargetRegistry.h: No such file or directory
    5 | #include "llvm/Support/TargetRegistry.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [/home/why/ics2021/nemu/scripts/build.mk:40: /home/why/ics2021/nemu/build/obj-riscv32-nemu-interpreter/src/utils/disasm.o] Error 1```

Question Answer

Actually, It’s part of the NJU ICS Course project, and the right path should be #include "llvm/MC/TargetRegistry.h". For llvm-11, the file is in “llvm/Support/TargetRegistry.h”. But for llvm-14, it’s in “llvm/MC/TargetRegistry.h”. You should check where the TargetRegistry.h is. For me with Ubuntu, the file is at /usr/include/llvm/MC/.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.