0

I am trying to install C library GR [Link] on Ubuntu 18.04, after following the instructions to install, there is no error while installing but when using it gives the error :

foo.c:2:10: fatal error: gr.h: No such file or directory #include ^~~~~~ compilation terminated.

This is while compiling the example given on their installation page.

Is the installation faulty? Can anyone help me regarding this?

Thank You in advance.

5
  • Please improve the question: are you trying to compile the sample from the installation page or it's your project?
    – AndrewQ
    Mar 24, 2019 at 23:00
  • I am trying to compile the sample from installation page. Mar 24, 2019 at 23:06
  • Did you install the dependencies? Mar 24, 2019 at 23:12
  • Yes, I did install the dependencies. Mar 24, 2019 at 23:17
  • The C compiler does not find the "gr.h" header file. 1) Check if the file exists and if you can access it. 2) Try to modify the example in: #include "path_to_gr.h/gr.h"
    – AndrewQ
    Mar 25, 2019 at 10:48

1 Answer 1

0

By specifying location of GR through addition flags the compilation is possible.
Assuming GR is installed in /usr/local/gr.
The command to run foo.c should be :

gcc -I/usr/local/gr/include foo.c -L/usr/local/gr/lib -lGR -Wl,-rpath,/usr/local/gr/lib

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .