Usage of multi idl files.

2 posts / 0 new
Last post
isa Özyıldırım's picture
Offline
Last seen: 3 weeks 6 days ago
Joined: 04/19/2024
Posts: 6
Usage of multi idl files.

hello,

I have  2 idl files (see please attachment files). 

- Common.idl => Enumtypes are defined

- Example.idl => use these enum types  , this file includes also Common.idl file

So i want to create basic publisher and subscriber from these idls.

what i can do :

- remove include line  "#include "Common.idl" from  Example.idl  and add the content of the Common.idl  to the Example.idl file.

so i can create publisher and subscriber from Example.idl  file. it so works.

my issue:

how can i publisher and subscriber from Example.idl which includes Common.idl file ?

i use so rtiddsgen with Directory selection.

"C:\D_Data\PROJECT\TPOC\DDS\appsdk-main\idls\dummy -inputIdl -d C:\D_Data\PROJECT\TPOC\DDS\c++\nested_idls -language C++98 -create typefiles -create exampleFiles -create makefiles -platform x64Win64VS2017"

But i creates so 2 different solution per idl file

 

 

 

AttachmentSize
Binary Data common.idl580 bytes
Binary Data example.idl172 bytes
Package icon dummy.zip55.3 KB
Organization:
Howard's picture
Offline
Last seen: 1 day 13 hours ago
Joined: 11/29/2012
Posts: 583

So, using rtiddsgen to generate example apps that publish and subscribe to a data type that is defined in an IDL is only supported as an example when using a single IDL file.

In a real system, you would only be using rtiddsgen to generate the source files needed to support a data type, and not be trying to use it to generate source files for your application code.

If you want to have a more complex IDL design in which IDL files include other IDL files, you have to use rtiddsgen on EACH .idl file to generate the source code to support the data types defined by each file.  AND, then in your project, you have to include the generated source code for all of the IDL files.

That's not something that rtiddsgen does when it generates example apps.

So, you would have to run "rtiddsgen common.idl " (with appropriate command line args to configure language if not using C++98), and then run "rtiddsgen example.idl -example <arch>" that will also generate the code and project/makefile for the example apps.

And then you have to modify the project/makefile to add the source code generated for the common.idl file so that those files get compiled an linked with your example apps.

Again, this is not a process that we would expect customers to do when developing something other than a "helloworld" app.  Typically, you'll use whatever makefiles/projects that you have for your own development, make the appropriate modifications to add the paths to the include files, #defines for macros required by Connext, paths to the Connext libraries, a list of libraries to link, and then for every IDL file used by your app, a set of rtiddsgen-erated source files to compile and link with your own app source files.

You can use the rtiddsgen MSVC project files or makefiles that were generated as for an example app as your own example of how to configure your own projects/makefiles.