I installed the OpenVino on my Ubuntu 20.04 using the apt command.
sudo apt install intel-openvino-dev-ubuntu20-2021.3.394
I am trying to compile this simple program using gcc 1.c -linference_engine_c_api
.
#include <stdio.h>
#include <c_api/ie_c_api.h>
int main() {
printf("C API Successfully Loaded!");
}
But the compilation fails with the following error:
1.c:2:10: fatal error: c_api/ie_c_api.h: No such file or directory
2 | #include <c_api/ie_c_api.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
How do I solve this?
You cannot directly call gcc
for the 1.c file. You need to create a script to compile necessary dependencies (like CMake).
For example, in \opt\intel\openvino_2021.3.394\deployment_tools\inference_engine\samples\c there is build_sample.h script. This script is used to perform all compilation and it uses CMake
. Same goes for gcc
, to run the inference lib you need to compile the script first before calling ie_c_api.h
. 1.c file cannot be run directly when gcc
compiler does not support the operation.
Please go to Integrate the Inference Engine with Your Application - OpenVINO™ Toolkit (openvinotoolkit.org) for reference.