0

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.

4

1 回答 1

0

不太可能调用库文件liblibleda.aliblibleda.so:当链接器看到表单的选项时,-l<name>它将搜索名为lib<name>.so(对于共享库)或lib<name>.a(对于静态库)的库文件。您可能只想使用该选项-lleda(除非 LEDA 开发人员做了一些聪明的事情并将库称为类似libeda.a这样的库-leda)。

这是否有效还取决于安装和构建之间的编译器选项是否一致。

于 2012-10-30T19:56:37.927 回答