I use igraph in R. Now I am trying to move to Rcpp. igraph is written in C, but can be called from R. Now from C++ I would like to call it directly.
Currently my Rcpp C++ code calls R, which calls C again. That seems stupid. Instead, I wan't to call the C library directly from my Rcpp C++ code. One way, seems to be to simply download the igraph headers and add this in Rcpp:
#include <igraph-0.7.1\include\igraph.h>
but then the compiler complains that it can't find the actual code (only headers):
...
functions.o:functions.cpp:(.text+0x2fd): undefined reference to `igraph_matrix_set'
...
Compiling all of ipgraph as a Rcpp dependency seems to be a difficult, or at least I couldn't find no good documentation on how this could be done.
Given that igraph is called from R, i.e. is running on my system, I suspect that there should be a way to call it from C++ without going the detour through R, someting like
// [[Rcpp::depends(igraph)]]
Any pointers would be greatly appreaciated.