Open MarcusWichelmann opened 3 years ago
The C compiler can be given a -I flag to indicate a path where headers are expected to be found.
So probably adding clang -I tests ....
would work (assuming you are invoking clang in the root directory of the p4c-xdp project, since the ebpf_xdp.h file is there.) If this works for you we can update the README.
Thank you for your quick response.
Yes, that's what I meant with hack this together
. 😄 I managed to build it now by including these directories:
-I ../p4c/backends/ebpf/runtime/ \
-I ../p4c/extensions/p4c-xdp/tests/ \
-I ../p4c/backends/ebpf/runtime/contrib/libbpf/src/ \
Is it really necessary to include them manually or is there something wrong with my install (debian 10, built from sources) annd normally the headers get installed into the system?
Anyway, adding a hint to the Readme would probably be helpful for others.
This package does not install anything on your system, so you will need to specify the path to the headers.
When compiling a .p4 file as described in the readme, clang cannot find the
ebpf_xdp.h
header:The header file is included in this repository and says
But how am I supposed to include it? Of course, I could hack this together somehow, but I'm wondering what is the correct way you intended for this. 😄 Maybe the Readme needs an update?