为什么IDL不完整?

时间:2013-12-13 03:58:59

标签: idl ace tao data-distribution-service

我在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 dev指南的第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 */

1 个答案:

答案 0 :(得分:2)

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