This is the error I got:
D:/face_recongition/learn-to-cluster-master/igraph-example-master/cmake-project/build/runWalktrap.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
This is the cmake file:
cmake_minimum_required(VERSION 3.18)
project(runWalktrap)
find_package(igraph REQUIRED)
add_executable(runWalktrap runWalktrap.c)
target_link_libraries(runWalktrap PUBLIC igraph::igraph)
This is the walktrap code:
#include <igraph.h>
int main(void) {
igraph_t g;
igraph_matrix_int_t merges;
igraph_vector_t modularity;
igraph_integer_t no_of_nodes;
igraph_integer_t i;
igraph_small(&g, 5, IGRAPH_UNDIRECTED,
0, 1, 0, 2, 0, 3, 0, 4, 1, 2, 1, 3, 1, 4, 2, 3, 2, 4, 3, 4,
5, 6, 5, 7, 5, 8, 5, 9, 6, 7, 6, 8, 6, 9, 7, 8, 7, 9, 8, 9, 0, 5, 4, 9, -1);
igraph_vector_init(&modularity, 0);
igraph_matrix_int_init(&merges, 0, 0);
igraph_community_walktrap(&g,
NULL /* no weights */,
4 /* steps */,
&merges, &modularity,
/* membership=*/ NULL);
no_of_nodes = igraph_vcount(&g);
printf("Merges:\n");
for (i = 0; i < igraph_matrix_int_nrow(&merges); i++) {
printf("%2.1" IGRAPH_PRId " + %2." IGRAPH_PRId " -> %2." IGRAPH_PRId " (modularity %4.2f)\n",
MATRIX(merges, i, 0), MATRIX(merges, i, 1),
no_of_nodes + i, VECTOR(modularity)[i]);
}
igraph_destroy(&g);
igraph_matrix_int_destroy(&merges);
igraph_vector_destroy(&modularity);
return 0;
}
I am using the example code from GitHub - igraph/igraph-example: Example projects that demonstrate the usage of igraph, and replace one of the c file with my code, and following the instruction to compile and run my c code. Then I got this error. Does anyone has idea how to fix this problem? Thank you very much!