I am using graph-0.6 on ubuntu 12.04
IDE Eclipse CDT C++
Have this example code from http://igraph.sourceforge.net/doc/html/ch04s02.html#igraph_add_vertices
When I try to compile I get
undefined reference to: igraph_vector_init and the rest of the functions.
It finds the header file and can create a graph structure (igraph_g t;)
#include <iostream>
#include <igraph.h>
using namespace std;
int main() {
igraph_t g;
igraph_attribute_table_t *
igraph_i_set_attribute_table(const igraph_attribute_table_t * table);
igraph_t g1;
igraph_vector_t v1;
int ret;
/* Create a graph */
igraph_vector_init(&v1, 8);
VECTOR(v1)[0]=0; VECTOR(v1)[1]=1;
VECTOR(v1)[2]=1; VECTOR(v1)[3]=2;
VECTOR(v1)[4]=2; VECTOR(v1)[5]=3;
VECTOR(v1)[6]=2; VECTOR(v1)[7]=2;
igraph_create(&g1, &v1, 0, 0);
igraph_vector_destroy(&v1);
/* Add more vertices */
igraph_add_vertices(&g1, 10, 0);
if (igraph_vcount(&g1) != 14) {
return 1;
}
igraph_destroy(&g1);
return 0;
}