I have successfully built OpenDDS 3.13.2 from source. Here is my environment:
- Windows 10
- Visual Studio 2017 (re-targeted Solution to SDK 10.0.17763.0)
- Tried all Configuration/Platform combinations
I successfully used the configure script from the VS command prompt, built everything by opening the generated solution in the same command prompt, and finally ran the Messenger example (publisher and subscriber), and even configured it to use RTPS successfully.
However, when I try to create my own IDL and use the tao_idl, it crashes. Here's my test (using the proper environment from setenv.cmd):
> tao_idl (no args)
IDL: No input files
Second test:
> tao_idl Test.idl (crashes)
I get no error message, and am unable to locate logs or any indication of what went wrong. The same thing happens when I used opendds_idl.
What is the best approach to debug this, and/or are there pre-built binaries available for the IDL compiler(s) (both TAO and OpenDDS)?
After about a day of troubleshooting, I have determined a solution. Despite being able to call tao_idl and opendds_idl yourself, you should basically never do it. There are a good amount of command-line arguments needed to get both to work, and if they're not present, each exe will crash without the proper reasoning why.
I will add my steps below to create a new basic two-exe pub/sub project using OpenDDS:
Messenger.idlwith your IDL file name.Create a new file called
<your project>.mwc, and add the following contents:Open a new VS command-line terminal and run
$DDS_ROOT/setenv.cmd, or open a regular terminal if you have those environment variables set via Windows settings.Navigate to your project directory and call:
mwc.pl -type vs2017, replacing "vs2017" as needed for your build tool/IDE.Open up the generated solution, and retarget it as necessary for your Windows SDK version.
Build the
<your project>_IDLproject first. If you notice in the output window, it is invoking thetao_idlandopendds_idlcommands automatically. You can view the.vcxprojfiles to see the full command-line arguments that were the original problem.Modify the
publisher.cpp,subscriber.cpp, andDataReaderListenerImpl.cppfiles to match your new IDL. Run the example as usual and ta-da!For completeness, the full commands for both
tao_idlandopendds_idlare as follows: