I've been experimenting with igraph for a few weeks on my Macintosh and it's been working great. The application that I'm working towards will need to run on Windows, as well as Macintosh, so I've installed Cygwin on a Windows machine across the hall to experiment. I've been able to compile some simple programs on Cygwin that work fine on Windows but I've yet to get the simplest igraph programs to compile. I have built the igraph library and it seems to have installed fine into /usr/local/include/igraph and /usr/local/lib, but I get undefined reference errors when trying to compile a program.
I've included the command line compilation errors and the program below. Note that the program comes from the igraph tutorial here: http://cneurocvs.rmki.kfki.hu/igraph/doc/html/ch03s01.html
Thanks for any assistance, Mark McClure
------- Compilation errors --------------- $ gcc -mno-cygwin -I/usr/local/include/igraph -L/usr/local/lib -ligraph -o first_igraph first_igraph.c /cygdrive/c/DOCUME~1/STUDEN~1.RBH/LOCALS~1/Temp/ccfgahVf.o:first_igraph.c:(.text+0x60): undefined reference to `_igraph_erdos_renyi_game' /cygdrive/c/DOCUME~1/STUDEN~1.RBH/LOCALS~1/Temp/ccfgahVf.o:first_igraph.c:(.text+0x9a): undefined reference to `_igraph_diameter' /cygdrive/c/DOCUME~1/STUDEN~1.RBH/LOCALS~1/Temp/ccfgahVf.o:first_igraph.c:(.text+0xb8): undefined reference to `_igraph_destroy' collect2: ld returned 1 exit status -------------------------------------------
--- The program from the igraph tutorial -- #include <igraph.h>
int main(void) { igraph_real_t diameter; igraph_t graph; igraph_erdos_renyi_game(&graph, IGRAPH_ERDOS_RENYI_GNP, 1000, 5.0/1000, IGRAPH_UNDIRECTED, IGRAPH_NO_LOOPS); igraph_diameter(&graph, &diameter, 0, 0, 0, IGRAPH_UNDIRECTED, 1); printf("Diameter of a random graph with average degree 5: %f\n", (double) diameter); igraph_destroy(&graph); return 0; }