【发布时间】:2013-12-13 03:58:59
【问题描述】:
我在 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 */
【问题讨论】:
-
StockQuoterTypeSupport.idl中生成的内容,应该包含QuoteTypeSupport、QuoteDataWriter和QuoteDataReader接口。
-
这些是我需要的对象,但由于某种原因它们没有出现。我发布了生成的 IDL。我也在详细模式下运行它,并没有发现任何异常。
-
看来 opendds_idl 编译器有问题。您可以尝试使用 ACE/TAO x.2.3 重新编译 OpenDDS,您可以从 download.dre.vanderbilt.edu 获得。我的系统上有这种组合,并且可以正常工作。
-
我也想知道这一点。我会在下周中旬回来,如果有答案,我会告诉你进展如何。
-
@JohnnyWillemsen Thnx,有些东西没有正确构建,现在可以使用。如果您想将此作为答案,我会标记它。
标签: idl ace tao data-distribution-service