G. Ajello
G. Ajello

Reputation: 13

How to import an external C library?

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.

Upvotes: 1

Views: 295

Answers (1)

djiang
djiang

Reputation: 48

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.

Upvotes: 1

Related Questions