0

我在 Linux 上使用 OpenDDS 3.4.1 并尝试手动编译 IDL,因为我已经有一个项目的构建系统并且只想生成所需的文件并进行集成。这是我正在使用的测试 IDL。

#include "orbsvcs/TimeBase.idl"

module StockQuoter {
#pragma DCPS_DATA_TYPE "StockQuoter::Quote"
#pragma DCPS_DATA_KEY "StockQuoter::Quote ticker"

    struct Quote {
        string ticker;
        string exchange;
        string full_name;
        double value;
        TimeBase::TimeT timestamp;
    };
};

然后编译IDL如下:

$ opendds_idl ./StockQuoter.idl
processing ./StockQuoter.idl

$ tao_idl -I$DDS_ROOT/DDS -I$TAO_ROOT/orbsvcs ./StockQuoter.idl
processing ./StockQuoter.idl

但是一旦我开始在生成的 IDL 上使用 tao_idl,我会得到以下信息:

$tao_idl -I$DDS_ROOT/DDS -I$TAO_ROOT/orbsvcs ./StockQuoterTypeSupport.idl

.../ACE_wrappers/bin/tao_idl: "./StockQuoterTypeSupport.idl", line 21: module must contain at least one declaration: ::StockQuoter
.../ACE_wrappers/bin/tao_idl: "./StockQuoterTypeSupport.idl", line 21: module must contain at least one declaration: ::StockQuoter
.../ACE_wrappers/bin/tao_idl: "./StockQuoterTypeSupport.idl", line 21: module must contain at least one declaration: ::StockQuoter
.../ACE_wrappers/bin/tao_idl: "./StockQuoterTypeSupport.idl", line 21: module must contain at least one declaration: ::StockQuoter

当然,结果意味着我无法在我的 pub/subs 中注册类型支持,因为缺少所需的对象,我可以通过查看 StockQuoterTypeSupport.idl 文件来确认。我查看了 OpenDDS 开发指南第 8 章的 opendds_idl 参数,但似乎没有任何效果。有任何想法吗?

编辑:
这是生成的 IDL StockQuoterTypeSupport.idl。

/* Generated by .../DDS/bin/opendds_idl version 3.4.1 (ACE version 5.6a_p14)  
   running on input file ./StockQuoter.idl*/
#ifndef OPENDDS_IDL_GENERATED_STOCKQUOTERTYPESUPPORT_IDL_X54N2R
#define OPENDDS_IDL_GENERATED_STOCKQUOTERTYPESUPPORT_IDL_X54N2R
#include "./StockQuoter.idl"

#include "dds/DdsDcpsInfrastructure.idl"
#include "dds/DdsDcpsPublication.idl"
#include "dds/DdsDcpsSubscriptionExt.idl"
#include "dds/DdsDcpsTopic.idl"
#include "dds/DdsDcpsTypeSupportExt.idl"

/* Begin MODULE: StockQuoter */

/* Begin STRUCT: Quote */

module StockQuoter {
};

/* End STRUCT: Quote */

/* End MODULE: StockQuoter */
#endif /* OPENDDS_IDL_GENERATED_STOCKQUOTERTYPESUPPORT_IDL_X54N2R */
4

1 回答 1

2

看起来 opendds_idl 编译器有问题。您可以尝试使用 ACE/TAO x.2.3 重新编译 OpenDDS,您可以从 download.dre.vanderbilt.edu 获得。我的系统上有这种组合,并且可以正常工作。

于 2013-12-22T14:15:49.017 回答