igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] compiling and linking question


From: Gábor Csárdi
Subject: Re: [igraph] compiling and linking question
Date: Thu, 25 Sep 2008 15:01:17 +0200

Bhalchandra,

-l just means that you want to link against the igraph library. If you
want to compile programs using igraph, you need

1) -I<igraph-include-directory>
2) -ligraph
3) -L<igraph-library-directory>

<igraph-include-directory> is the directory where the igraph.h file is.
<igraph-library-directory> is the directory where the libigraph.so
file is (assuming Linux, for other operating systems it has a
different name)

If you want to compile and link in two separate steps, then use 1) for
compilation and both 2) and 3) for linking.

Hope it helps,
Gabor

On Thu, Sep 25, 2008 at 2:51 PM, Bhalchandra Thatte <address@hidden> wrote:
> Pardon my silly question. I am trying to set up a development
> environment so that I can start using igraph in some C++ programs.
> I want to know what -ligraph means and how it should be modified for
> my particular installation. I know this is probably a newbie question.
> Here is the command I run.
> g++ A.o B.o -O2 -Wall -L../../local/igraph/lib -ligraph -o main
>
> I get the error /usr/bin/ld: cannot find -ligraph
> collect2: ld returned 1 exit status
> make: *** [main] Error 1
>
> I have a /local directory (and relative to my program, it is
> ../../local), and within it I have /bin, /lib, and /include, and as
> you can see I have managed to create the object files.
>
> I don't fully understand compiling, linking, makefiles, ... but I had
> one makefile automatically created, and I normally manage to hack it
> for my purpose. But this time it is I think the installation in a
> non-default location, that I am unable to hack it.
>
> Thanks for the help.
> Bhalchandra Thatte
>
> --
> Department of Statistics, 1 South Parks Road, University of Oxford,
> Oxford OX1 3TG, United Kingdom
> Phone: +44 (0)1865 285 366
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>




reply via email to

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