On ubuntu, if libcxxabi is installed, and gcc used as compiler, then there is a chance that an compilation error will be thrown
../include/hobbes/lang/preds/subtype/obj.H:52:23: error: ‘__si_class_type_info’ in namespace ‘__cxxabiv1’ does not name a type; did you mean ‘__class_type_info’?
52 | typedef __cxxabiv1::__si_class_type_info si_class_type;
Basically, it is about wrong cxxabi.h in Obj.H gets included
This is caused by search order of include path, llvm path will be searched before system default folder, and in llvm path, there is a cxxabi.h installed by libcxxabi, so this one will be used instead of the one with gcc, thus compilation fails
To solve this problem, at least when compiling with gcc, llvm path has to be searched after system default path, -idirafter is the only solution I got
without -idirafter
#include <...> search starts here:
../include
/usr/lib/llvm-10/include # <-- wrong cxxabi.h
/usr/include/c++/9 # should be this one
...
End of search list.
with -idirafter
#include <...> search starts here:
../include
/usr/include/c++/9 # correct order
...
/usr/lib/llvm-10/include # wrong one will not be used
End of search list.
On ubuntu, if libcxxabi is installed, and gcc used as compiler, then there is a chance that an compilation error will be thrown
Basically, it is about wrong
cxxabi.h
inObj.H
gets includedThis is caused by search order of include path, llvm path will be searched before system default folder, and in llvm path, there is a
cxxabi.h
installed by libcxxabi, so this one will be used instead of the one with gcc, thus compilation failsTo solve this problem, at least when compiling with gcc, llvm path has to be searched after system default path,
-idirafter
is the only solution I gotwithout
-idirafter
with
-idirafter