什么是simgrid的动态链接库以及如何处理后续问题

时间:2016-06-01 10:20:06

标签: reference undefined simgrid

test_simdag.c:(.text+0x1e): undefined reference to `SD_init'
test_simdag.c:(.text+0x45): undefined reference to `SD_task_creat_comp_seq'
test_simdag.c:(.text+0x72): undefined reference to `SD_task_creat_comp_seq'
test_simdag.c:(.text+0x9f): undefined reference to `SD_task_creat_comp_seq'
test_simdag.c:(.text+0xcc): undefined reference to `SD_task_create_com_e2e'
test_simdag.c:(.text+0xef): undefined reference to `SD_task_dependency_add'

1 个答案:

答案 0 :(得分:0)

我用“apt-get install simgrid”安装了simgrid。 test-simgrid.c的内容是:

#include "simdag/simdag.h"
int main(int argc, char **argv)
{
    SD_task_t c1, c2, c3, t1;
    SD_init(&argc, argv);

    c1 = SD_task_create_comp_seq("c1", NULL, 1E9);
    c2 = SD_task_create_comp_seq("c2", NULL, 5E9);
    c3 = SD_task_create_comp_seq("c3", NULL, 2E9);

    t1 = SD_task_create_comm_e2e("t1", NULL, 5e8);

    SD_task_dependency_add("c1-t1", NULL, c1, t1);
    SD_task_dependency_add("t1-c3", NULL, t1, c3);
    SD_task_dependency_add("c2-c3", NULL, c2, c3);

    SD_exit();
    return 0;
}