Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Omnet++ 如何在Omnet上使用LEDA图形库++;项目?_Omnet++ - Fatal编程技术网

Omnet++ 如何在Omnet上使用LEDA图形库++;项目?

Omnet++ 如何在Omnet上使用LEDA图形库++;项目?,omnet++,Omnet++,我正在尝试使用Omnet++4.2.2中的LEDA-6.3库。我安装了LEDA,并在Ubuntu终端上运行了一个简单的程序。但是,当我将代码移植到Omnet++时,它失败了。下面是我的简单代码 #include <LEDA/graph/graph.h> #include <omnetpp.h> class cLeda : public cSimpleModule { protected: virtual voi

我正在尝试使用Omnet++4.2.2中的LEDA-6.3库。我安装了LEDA,并在Ubuntu终端上运行了一个简单的程序。但是,当我将代码移植到Omnet++时,它失败了。下面是我的简单代码

    #include <LEDA/graph/graph.h>
    #include <omnetpp.h>

    class cLeda : public cSimpleModule
    {
      protected:
        virtual void initialize();
    };

    Define_Module(cLeda);

    void cLeda::initialize()
    {
        EV << "TestLEDA";
        graph g;
        g.read("nsfnet.txt");
        EV << "No. nodes = " <<g.number_of_nodes() << endl;
    }

我很感激任何能帮助我实现这一目标的想法。非常感谢。

OMNeT++项目通常使用Makefile。尝试将
LEDA
库添加为
Makefrag
。 转到
Project Properties
,选择
OMNeT++
|
Makemake
|选择
src
|
选项
|
自定义
|
Makefrag
,然后编写:

    INCLUDE_PATH += -I/home/grsst/LEDA-6.3/incl
    LIBS += -L/home/grsst/LEDA-6.3  -lleda

不客气。你能把这个答案作为你问题的答案吗?这将对其他人有帮助。嗨,杰兹,我想把我的问题标记为“不知道如何解决”,你能告诉我怎么做吗?谢谢描述了如何接受答案以及如何投票。
    INCLUDE_PATH += -I/home/grsst/LEDA-6.3/incl
    LIBS += -L/home/grsst/LEDA-6.3  -lleda