我在Linux上使用OpenDDS 3.4.1并尝试手动编译IDL,因为我已经有了一个用于该项目的构建系统,并且只想生成所需的文件并进行集成。这里有一个我正在使用的测试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
但是一旦我使用tao_idl上生成的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_idl参数的OpenDDS开发指南第8章,但似乎没有任何工作。有任何想法吗?
编辑:
以下是生成的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。我也用冗长的模式运行它,没有看到任何不寻常的东西。 – Ender
它看起来有一个opendds_idl编译器的问题。您可以尝试使用ACE/TAO x.2.3重新编译OpenDDS,您可以从http://download.dre.vanderbilt.edu/获取它。我在我的系统上有这种组合,并且没有问题。 –