I am new to RTI/DDS. I am using .Net. I am able to download, build, and run the rticonnextdds-getting-started hello_world with Visual Studio 2022. I have build some idl that has includes. My rtiddsgen commands is this:
rtiddsgen -language c# -d generated -ppOption /nologo -ppOption /C -ppOption /E -ppOption /X -ppOption -C -ppPath "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe" *.idl
The *.idl is just to indicate all my idl files. They rtiddsgen without error. I get all the cs and Plugin.cs files I expect. I drop those into the hello_world project, but then get this compilation error.
C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets(75,5): error MSB6006: "csc.exe" exited with code -2146232797.
Any thoughts? Do I need to install an older version of Visual Studio to use the cl.exe.
I assume that you are using Connext 6.1.1? From where are you getting the Connext libs supporting .NET? Which version of the .NET framework are you using?
And where did you get a C# "hello_world" project? Did you create that manually?
Yes, 6.1.1. Nuget.org:
<PackageReference Include="Rti.ConnextDds" Version="6.1.1" />
<PackageReference Include="Rti.ConnextDds.Extra" Version="6.1.1" />
<PackageReference Include="Rti.ConnextDds.Native" Version="6.1.1" />
I have tried net5.0 and net6.0 with the same results.
I got the hello world from a link in the get started from rti website.
https://github.com/rticommunity/rticonnextdds-getting-started
The github repository doesn't have project files for Visual Studio. So, how did you get the project files?
Did you run
rtiddsgen -language c# -example net5 -d csharp -ppDisable hello_world.idl
If so, without modifying the project, did you get the vanilla "hello_world" example to compile and run in .NET5?
What is your idl file using #include to do?
Did you do anything else except add the generated .cs files to the project?
Yes I followed those instructions for rtiddsgen. Yes the vanilla project compiled and ran. I didn't do anything additional to the generated cs files; just changed the rtiddsgen arguments to support the include directives. I have 73 files with 564 structures that I converted from another architecture we use. I don't get any errors on the rtiddsgen.
What does your #includes do?
In any case, looking up "MSB6006" on Google seems to indicate that this is an error with Visual Studio itself...
Can you try a different version of Visual Studio?
I tried VS2019. I also used the cl.exe from 2019. Get the same error. Determined it has to do with large enumerations. If I truncate my enumerations it works. I don't know what the max size is or if there is a way to allow large ones.
Guessing it has to do with this generated method
internal static DynamicType CreateDynamicType(bool isPublic = true)
it has the return with an AddMember for each EnumMember. Are there any different options for that particular type of generation?
Well, glad that you were able to track this down. Unfortunately, you're stepping into something beyond what this forum can help you with. I think you'll need to work with RTI's support/development team directly on this to track this down.
Does the code compile and work fine with other platforms such as Linux?