I am trying to install IGraph 0.3.2 on Cygwin (latest version). Running ./configure; make; make install works fine and everything looks nicely installed in /usr/local/lib and /usr/local/include/igraph.
The problems start when I try to build an application that uses the lib, specifically its the linking that does not work. Compiling the following program:
#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; }
I compile the program: $ gcc -I/usr/local/include/igraph -L/usr/local/lib -ligraph igraph_test.c
igraph_test.c:13:2: warning: no newline at end of file /cygdrive/c/DOCUME~1/Ulrik/LOCALS~1/Temp/cc8Hzl0x.o:igraph_test.c:(.text+0x60): undefined reference to `_igraph_erdos_renyi_game' /cygdrive/c/DOCUME~1/Ulrik/LOCALS~1/Temp/cc8Hzl0x.o:igraph_test.c:(.text+0x9a):
undefined reference to `_igraph_diameter' /cygdrive/c/DOCUME~1/Ulrik/LOCALS~1/Temp/cc8Hzl0x.o:igraph_test.c:(.text+0xb8): undefined reference to `_igraph_destroy' collect2: ld returned 1 exit status
examining the lib file with objdump shows that the functions are there, but the linker does not recognize it for some reason. I am running out ideas and would really appreciate help. Does anyone have any idea what the problem could be?