Al momento de terminar de compilar en visual studio c++ aparece el mensaje “igraph.lib no es una aplicación win32” no sé cuál es el problema porque no aparece ningún error de código. AYUDA!!. El sistema operativo de mi computador es windows.
Could you please report exactly what you did? That way we can try to reproduce your error and perhaps be able to help you. Have you been able to compile and run the supplied test program?
We will be switching to another build system in the near future (CMake), which should make it substantially easier to compile igraph on Windows.
P.S. My Spanish is not so great, so I might miss some things.
Hola vtraag, lo que hice es instalar paso a paso la librería, luego abrí el archivo igraph.sln, luego abrí un nuevo proyecto para la solución de igraph, al momento de escribir el código, Visual Studio no identifica ningún error de escritura. Luego, al depurar el código arroja el mensaje antes mencionado y al compilar arroja un par de errores LNK2019. Si puedes, te pido por favor que me envíes un video tutorial de como instalar y ejecutar un proyecto en Visual Studio con igraph, ya que necesito utilizar watts-strogatz lo antes posible. Adjunto capturas de pantalla para que veas lo que pasa. Quedo atento.
It seems you are trying to link to the dynamic igraph
library, you probably have compiled a static library. If you want to use the static library, you have to include #define IGRAPH_STATIC 1
in your project before you include igraph.h
. This is also documented on https://igraph.org/c/compilation-windows.html.
Utilizo éste código, sigue ocurriendo lo mismo…
#define IGRAPH_STATIC 1
//#pragma comment(lib, "igraph.lib")
#include <igraph.h>
int main(void)
{
igraph_integer_t diameter;
igraph_t graph;
igraph_rng_seed(igraph_rng_default(), 42);
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: %d\n",
(int)diameter);
igraph_destroy(&graph);
return 0;
}
Cuando ocupo pragma comment, arroja este error:
LINK : warning LNK4098: la biblioteca predeterminada’LIBCMTD’ entra en conflicto con otras bibliotecas; use la biblioteca /NODEFAULTLIB:biblioteca
Please help me!
You are probably mixing different modes of compilation. The igraph
library is probably built with a debug static runtime library (/MTd
). You need to build your own program with the same runtime library (i.e. probably also with /MTd
). You should also be able to find this somewhere in your project configuration, see here for more details.