[Top][All Lists]

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

[igraph] C igraph compilation problem on Lion

From: Wu Degang
Subject: [igraph] C igraph compilation problem on Lion
Date: Sat, 05 Nov 2011 00:24:52 +0800
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1


Recently I installed igraph library on Lion through macport. I just copied the example C program code from the manual and tried to compile it. The program code is:

#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_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;

The compilation was done on Eclipse. The following is the error message from Eclipse:
make all
Building file: ../src/test2.c
Invoking: GCC C Compiler
gcc -I/opt/local/include/igraph -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/test2.d" -MT"src/test2.d" -o "src/test2.o" "../src/test2.c"
Finished building: ../src/test2.c

Building target: test2
Invoking: GCC C Linker
gcc -L/opt/local/lib -o "test2" ./src/test2.o -l/opt/local/lib/libigraph.a
ld: library not found for -l/opt/local/lib/libigraph.a
collect2: ld returned 1 exit status
make: *** [test2] Error 1

This is really puzzling because I am sure the library path is correct.


reply via email to

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