Hi. I am migrating to RHEL7 from 6.5 So I am also upgrading from Connext 5.1.0 to Connext 5.2.3.
In doing that rtiddsgen no longer works. (edit this seems to also not work with rtiddsgen2 from Connext 5.1.0. I need to look up the differences between gen and gen2)
Making IDL: DcrStatusUpdate.idl...
rtiddsgen -language C++ -namespace-I/home/rti_connext_dds-5.2.3/include
-I/home/rti_connext_dds-5.2.3/include/ndds
-I/home/code/RHEL7_Updates/Dcs/include
-I/home/code/RHEL7_Updates/Dcs/dds/idl/DcrTestA
-I/home/code/RHEL7_Updates/Dcs/dds/idl/DcsPublisherId -replace DcrTestB.idl
INFO com.rti.ndds.nddsgen.Main Running rtiddsgen version 2.3.3, please wait ...
ERROR com.rti.ndds.nddsgen.Main DcrStatusUpdate.idl line 51:16 member type 'DcsPublisherId' not found
ERROR com.rti.ndds.nddsgen.Main Fail: The file couldn't be parsed and the rawTree wasn't generated
INFO com.rti.ndds.nddsgen.Main Done (failures)
make: *** [DcrStatusUpdate.cxx] Error 255
My IDL is the following.
#include "DcsPublisherId.idl"
#include "DcrTestA.idl"
module Dcs_Idl
{
// DcrStatusUpdate - update the status of a DCR.
struct DcrTestB
{
// Identifer of the publishers of this topic
DcsPublisherId publisherId_;
DcrTestA dcrUpdate; //@key
};
};
The issue can be resolved by removing the #include DcsPublisherId.idl.
The problem is that the DcrTestB idl includes DcsPublisherId because it declares it. But DcrTestA also include and declares DcsPublisherId. So rtiddsgen seems to try to compile DcsPublisherId twice. This seems like a bug though in rtiddsgen. Like when it is making its temp class files to generate the specified IDL its not adding the proper preprocessor to the headers.
#ifndef DcsPublisherId_H_
#def DcsPublisherId_H_
I would like to know where the issue is. Is it in rtiddsgen, or is there a flag I now need in rtiddsgen. Or should I just update the code?
Hi,
We have similar constructs in our IDL which do work without problems. The error is that it can't find the type, could this be a problem with modules? We do use #ifndef/#define also in our IDL files so that when an IDL file is included through multiple paths its contents is only included once.
Johnny
I am hesitant to call this an existing problem since it has worked fine for several versions of RTI now. 5.2 and 5.2.3 seem to both be behaving differently from 5.1 in this regard. I need to be able to justify changes before I start modifying IDL.
RTI DDS 5.2.0 (and 5.2.3) has a new rtiddsgen tool. Probably the change in behavior is because it behaves different. Have you tried the ifndef/define approach?
I just noticed this morning that I get the same problem using rtiddsgen2 from Connext 5.1. I would like to keep the c++ specific syntax out of my IDL files if possible. I would think that ifndef/define is extremely common/default C++ practice should be autogen'd into the IDL file when generating c++ code by default as well. Which it was doing with the older rtiddsgen tool.
Would recommend that you make a small isolated reproducer and send that to RTI support