I have an IDL that has mutliple #include and some of the "#include" has other embedded #include.
For example:
Main.idl:
#include "Types.idl"
#include "Enums.idl"
#include "Submain.idl"
struct MainICD { ...... }
The "Submain.idl" also has #include to "Types.idl", "Enums.idl".
When I use the converter to try to convert, it has a problem with converting the Submain and Main due to references in the type to the other idl file(s).
Is there any way to ensure this get converted correctly?
What do you mean "use the converter"? What is "the converter"? What are you trying to convert to? What is the problem? Are there error messages that you can share?
Hi Tan,
Are you using
#pragma once
or#ifndef
guards in your IDL files? Without one of these guards you may get errors during codegen for previously defined symbols.For example, in types.idl:
#ifndef __TYPES_IDL__
#define __TYPES_IDL__// define your types here
#endif
or using the pragma in types.idl:
#pragma once
// define your types here
I'm using the RT DDS Gen - Type Converter. I do have #ifdef JAVA .... #endif in the idl. Here's the command that's executed: /opt/rti_connext_dds-5.3.0/bin/rtiddsgen -ppDisable -d /home/user1/Desktop/IDLs/XML -convertToXml /home/user1/Desktop/IDLs/idl/[filename].idl. This is failling due to error with type references not found.
ERROR com.rti.ndds.nddsgen.Main VehicleLoiter.idl line 75:8 member type 'types::MeasurementSet' not found
ERROR com.rti.ndds.nddsgen.Main Fail: java.lang.Exception: The file couldn't be parsed and the rawTree wasn't generated
INFO com.rti.ndds.nddsgen.Main Done (failures)
At the top of the idl, I have the #ifndef ___[TYPES]__IDL___
and #define ___[TYPES]__IDL___
-ppDisable disables the use of the preprocessor which is required to process #include statements. If you remove that option does it convert successfully?
If you are using the GUI utility, there should be a check box next to the "Input file format" drop down that allows you to turn the preprocessor back on.
Here's the error I'm getting without the flag check.
INFO com.rti.ndds.Main Running rtiddsgen version 2.5.0, please wat ...
ERROR com.rti.ndds.nddsgen.IDLPreprocessor cpp: error trying to exec 'cclplus': execvp: No such file or directory
I have the standard gcc package install
Are you able to install the g++ package on this host as well? That should resolve the missing cc1plus issue.
Thanks! That works. Once I had the required g++, I was able to convert it without any issues.