[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] igraph compilation with Cygwin

From: Josep Bau
Subject: Re: [igraph] igraph compilation with Cygwin
Date: Thu, 13 Aug 2009 13:35:56 +0200

Thanks for the help.
I'll try the second option because after make and make install, I don't get any dll.

2009/8/13 Tamas Nepusz <address@hidden>
> I tried the line suggested by Tama specifying the linking at the end but I
> got an endless list of 'undefined reference to'.
Okay. Since it's a static library, it includes all the functions igraph
provides but not those that igraph uses from an external library. For
instance, igraph calls the functions of libxml2 when loading GraphML
files. So you have two choices:

1. Try to link to igraph dynamically (i.e., link to the DLL, but you
have to distribute the DLL with your application then). This is done by
something like that:

gcc -o igraph_test igraph_test.c -I./src -L./src -ligraph

2. Link to igraph statically, but then you will have to figure out what
other libraries you need to link to to satisfy those undefined
references. For instance, when I do the following on Linux:

gcc -o igraph_test igraph_test.c /home/local/tamas/lib/libigraph.a

I get a bunch of undefined references to functions like "floor", "log",
"exp" and so on. These are in the math library which is simply called
"m" on Linux. So I link to the math library dynamically and everything

gcc -o igraph_test igraph_test.c /home/local/tamas/lib/libigraph.a -lm

Alternatively, I can also link to the math library statically, in which
case I have to specify the full path to the math lib:

gcc -o igraph_test igraph_test.c /home/local/tamas/lib/libigraph.a

> The dll I was referring to is the one that comes with the compiled R package
That won't work, that is for the R package only. You should have a file
named libigraph.dll, libigraph-0.dll, cygigraph.dll, cygigraph-0.dll or
something like that in src/.libs in the directory where you built
igraph. That's the one you need.

Hope this helps,

igraph-help mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]