在REDHAWK中使用外部库 [英] Using external libraries in REDHAWK

查看:85
本文介绍了在REDHAWK中使用外部库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Eclipse CDT项目,该项目使用libsndfile源代码库中的自动工具.它在Eclipse中构建良好.如何修改该项目以将其用作dsp库和其他库的REDHAWK组件?

I have created an Eclipse CDT project that uses autotools from the libsndfile source code library. It builds fine in Eclipse. How do I modify this project to use it as a REDHAWK component the way that the dsp library and others are used?

谢谢!

推荐答案

有多种方法可以添加共享库以与REDHAWK一起使用.最简单的方法是在GPP上安装该库,并遵循REDHAWK中的包括外部库"一节中概述的步骤

There are multiple approaches to adding a shared library to work with REDHAWK. The simplest approach is to install the library on your GPP and follow the steps outlined in the section "Including External Libraries" found in the REDHAWK documentation.

在您询问的dsplib中采用的方法略有不同.这将创建一个REDHAWK软软件包库依赖关系,该依赖关系将安装在SDRROOT中,并在运行时与您的组件一起部署.以下是在REDHAWK中运行预先存在的c ++项目的步骤.该答案不涉及构建库或将其导入eclipse的过程,因为有关这些主题的文章很多:

The approach taken in the dsplib you asked about is slightly different. This creates a REDHAWK softpackage library dependency which is installed in the SDRROOT and deployed at runtime along with your component. Here are the steps to get a pre-exsisting c++ project working in REDHAWK. This answer does not cover getting the library to build or the process of importing it into eclipse as there are numerous posts on these topics:

  1. 将库导入到IDE中.

  1. Import the library into your IDE.

构建共享库,以便拥有共享库(.so文件)

Build your shared library so that you have a shared object (.so file)

向您的库中添加一个.spd.xml文件,例如找到的

Add a .spd.xml file to your library such as the one found here.

编辑此.spd.xml文件:

Edit this .spd.xml file:

4a.更新localfile标记以指向您特定.so文件的位置.

4a. Update the localfile tag to point to the location of your specific .so file.

4b.确保实现id标记的值是您的库的唯一修订号

4b. Ensure that the value of the implementation id tag is a unique revision number for your library

  1. 添加.project文件(如果不存在),例如找到的此处.打开您的.project文件,并确保包括以下性质:

  1. Add a .project file if it doesn't exist such as the one found found here. Open your .project file and ensure that the following natures are included:

<nature>gov.redhawk.ide.natures.sca.project</nature>
<nature>gov.redhawk.ide.natures.sca.component</nature>

  • 您现在应该可以将sofpackage库拖到SDR根目录中.

  • You should now be able to drag your sofpackage library to the SDR root.

    以下是使用新库来更新要构建的各个组件的步骤:

    Here are the steps to update your individual components you are building to make use of your new library:

    1. 在cpp实现文件夹中编辑组件Makefile.am.编辑_CXXFLAGS以将路径添加到头文件,_LDADD来添加库,而_LDFLAGS包括库的路径.请参阅此示例,以了解agc组件的修改方式这些变量包括dsp库.

    1. Edit the components Makefile.am in the cpp implementation folder. Edit the _CXXFLAGS to add the path to your header files, _LDADD to add your library, and _LDFLAGS to include the path to your library. See this example for how the agc component modifies these variables to include the dsp library.

    编辑.spd.xml文件以包括软件包依赖关系.在实现"部分下,在您的库上添加运行时依赖项,例如

    Edit the .spd.xml file to include the softpackage dependency. Under the implementation section add a run time dependency on your library such as the one found here. Specifically - your dependency section should be as follows:

    <dependency type="runtime_requirements">
      <softpkgref>
        <localfile name="XXXX"/>
        <implref refid="YYYY"/>
      </softpkgref>
    </dependency>
    

  • XXXX是相对于dom目录的SDRROOT中已安装的库.spd.xml文件的路径(应以/components开头)YYYY是您在上面4b中定义的特定实现值.

    XXXX is the path to your installed library .spd.xml file in the SDRROOT relative to the dom directory (it should start with /components) YYYY is your specific implementation value defined in 4b above.

    这篇关于在REDHAWK中使用外部库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆