Closed luxroot closed 3 years ago
Can you change the line to #include "llvm-c-9/llvm-c/Types.h"
?
It solved that error but gave me another one..
In file included from ../llvm/include/llvm-c/IRReader.h:17,
from dummy_irreader_ocaml.c:15:
/usr/include/llvm-c-9/llvm-c/Types.h:17:10: fatal error: llvm-c/DataTypes.h: No such file or directory
17 | #include "llvm-c/DataTypes.h"
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
Done: 27/30 (jobs: 1)make: *** [Makefile:8: all] Error 1
It seems like I should update some include paths. FYI, my machine has llvm9 and llvm10 too.
> ls /usr/include | grep llvm
llvm-10
llvm-9
llvm-c-10
llvm-c-9
OK. I see. Ideally, the directory structure should be like this (according to my system):
$ ls -al /usr/include | grep "llvm"
llvm -> llvm-9/llvm
llvm-9
llvm-c -> llvm-c-9/llvm-c
llvm-c-9
->
means symbolic link.
It also solved by editing src/dune
file
diff --git a/src/dune b/src/dune
index b2ea9c3..ec3e7ea 100644
--- a/src/dune
+++ b/src/dune
@@ -4,7 +4,7 @@
(libraries llvm)
(foreign_stubs
(language c)
- (include_dirs ../llvm/include/llvm-c)
+ (include_dirs ../llvm/include/llvm-c /usr/include/llvm-c-9)
(names dummy_irreader_ocaml))
(foreign_archives ../llvm/build/lib/DummyLLVMIRReader
../llvm/build/lib/DummyLLVMAsmParser))
Thanks for kind advice though! 👍🏻 :)
After running
When I run
make
at the base of repository, I encountered such error.It seems like there's no
Types.h
atllvm/include/llvm-c
, am I missing something?