Home > Back-end >  How to import an external C library?
How to import an external C library?

Time:01-06

I want to use GraphViz as a C library(cgraph) but I don't know how to actually "import" it.
The folder contains makefile.am, so I should use automake to get a makefile.in file. Where do I go from there?

I'm really confused on the actual procedure to follow.

CodePudding user response:

just share my experience. I have no permission to post a comment, thus I post an answer for your reference. I am using ubuntu 20.04.

In the beginning,

foo.c:4:10: fatal error: graphviz/cgraph.h: No such file or directory
    4 | #include <graphviz/cgraph.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.

Then, I install graphviz-dev and it works.

$ sudo apt-get install graphviz-dev

If this is not the answer you expected, please let me know. I will remove this post. Thank you.

  •  Tags:  
  • Related