Take the 2-minute tour ×

I am new to LEDA and I am working on LEDA6.3 Free Edition on OpenSuse 12.1. As a start I tried to write a simple code "Hello LEDA world" as in the manual http://www.leda-tutorial.org/en/official/ch01s02.html.

#include <LEDA/string.h>
#include <iostream>

using leda::string;
using std::cout;

int main() 
    string msg = "Hello LEDA world!";

    cout << msg << "\n";

The compilation phase works fine and I generated the .o file. But they mentioned that this file needs to be linked to the LEDA library and the only library available in the Free edition is the libleda.a and libleda.so

I am trying to link using the following command:

g++ -o welcome welcome.o -L$LEDAROOT -llibleda

What I get is:

/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: cannot find -llibleda

I was wondering if someone could help me with how to link my file with the leda library ? so I can get it to run.

Thanks all.

share|improve this question
add comment

1 Answer

It is unlikely that the library file is called liblibleda.a or liblibleda.so: when the linker sees a an option of the form -l<name> it will search for a library file named lib<name>.so (for shared libraries) or lib<name>.a (for static libraries). You probably just want to use the option -lleda (unless the LEDA developers did something clever and called the library something like libeda.a so you'd use -leda).

Whether this works will also depend on the compiler options being consistent between the installation and your build.

share|improve this answer
add comment

Your Answer


