如何在scilab的Linker_Flag变量中添加多个文件?

问题描述 投票:0回答:1

我正在使用Scilab版本6.1.0,并且操作系统是Ubuntu 18.04。我正在为现有库添加一个工具箱到Scilab。我已经分别在Scilab中连接了库的两个功能。我无法同时连接它们。我认为原因是文件“ builder_gateway_cpp.sce”中的Linker_Flag变量这是此文件的内容:

mode(-1)
lines(0)
toolbox_title = "test_toolbox";
Build_64Bits = %t;
path_builder = get_absolute_file_path('builder_gateway_cpp.sce');
Function_Names = [
        "get_random_gaussian","sci_get_random_gaussian","csci6";
        "colormap_jet", "sci_colormap_jet" , "csci6";
        ];   
//Name of all the files to be compiled
Files = [
                "source.cpp";
                "sci_get_random_gaussian.cpp";
                "sci_colormap_jet.cpp";
                ]
[a, opt] = getversion();
Version = opt(2);
if getos()=="Windows" then
    third_dir = path_builder+filesep()+'..'+filesep()+'..'+filesep()+'thirdparty';
    lib_base_dir = third_dir + filesep() + 'windows' + filesep() + 'lib' + filesep() + Version + filesep();
    inc_base_dir = third_dir + filesep() + 'windows' + filesep() + 'include';
    C_Flags=['-D__USE_DEPRECATED_STACK_FUNCTIONS__  -I -w '+path_builder+' '+ '-I '+inc_base_dir+' ']   
    Linker_Flag  = [lib_base_dir+"libraryname.lib "]

elseif getos()=="Darwin" then //Mac
    third_dir = path_builder+filesep()+'..'+filesep()+'..'+filesep()+'thirdparty';
        lib_base_dir = third_dir + filesep() + 'Mac' + filesep() + 'lib' + filesep() + Version + filesep();
        inc_base_dir = third_dir + filesep() + 'Mac' + filesep() + 'include' ;
        C_Flags=["-D__USE_DEPRECATED_STACK_FUNCTIONS__ -w -fpermissive -I"+path_builder+" -I"+inc_base_dir+" -Wl,-rpath "+lib_base_dir+" "]
        Linker_Flag = ["-L"+lib_base_dir+" -lmul -Wl,-rpath="+lib_base_dir]

else//LINUX

    third_dir = path_builder+filesep()+'..'+filesep()+'..'+filesep()+'thirdparty';
    lib_base_dir = third_dir + filesep() + 'linux' + filesep() + 'lib' + filesep() + Version + filesep();

    inc_base_dir = third_dir + filesep() + 'linux' + filesep() + 'include';

    C_Flags = ["-I"+inc_base_dir];

        Linker_Flag = ["-L" + lib_base_dir + " -lrand -Wl,-rpath="+lib_base_dir ]
end

tbx_build_gateway(toolbox_title,Function_Names,Files,get_absolute_file_path("builder_gateway_cpp.sce"), [],Linker_Flag, C_Flags,[]);

clear toolbox_title Function_Names Files Linker_Flag C_Flags;

您可以在其他部分看到变量Linker_Flag,其中仅存在用于编译-sci_get_random_gaussian.cpp的-lrand文件的链接。 ”。我应该怎么做?

linux scilab toolbox
1个回答
0
投票

Linker_Flag = [“ -L” + lib_base_dir +“ -lcolormap_jet -lrand -Wl,-rpath =” + lib_base_dir]

© www.soinside.com 2019 - 2024. All rights reserved.