[Top][All Lists]

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

Re: [igraph] compiling igraph C under linux

From: Galen Wilkerson
Subject: Re: [igraph] compiling igraph C under linux
Date: Thu, 17 Nov 2011 10:34:46 -0500


I am compiling a small sample igraph program as follows and getting
the following error:

$ g++ -I/usr/include/igraph igraphTest.cc
/tmp/ccDMytBa.o: In function `main':
igraphTest.cc:(.text+0x36): undefined reference to `igraph_erdos_renyi_game'
igraphTest.cc:(.text+0x69): undefined reference to `igraph_diameter'
igraphTest.cc:(.text+0x8c): undefined reference to `igraph_destroy'
collect2: ld returned 1 exit status

The 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);
  return 0;


Looking in /usr/include/igraph:

/usr/include/igraph$ grep igraph_erdos_renyi_game *
igraph.h:int igraph_erdos_renyi_game(igraph_t *graph, igraph_erdos_renyi_t type,
igraph.h:int igraph_erdos_renyi_game_gnp(igraph_t *graph,
igraph_integer_t n, igraph_real_t p,
igraph.h:int igraph_erdos_renyi_game_gnm(igraph_t *graph,
igraph_integer_t n, igraph_real_t m,

system info:

$ uname -a
Linux erzsebet 2.6.32-33-server #72-Ubuntu SMP Fri Jul 29 21:21:55 UTC
2011 x86_64 GNU/Linux

thanks very much for any help,

reply via email to

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