Mono + C# + (CMAKE)

2 posts / 0 new
Last post
Offline
Last seen: 6 years 5 months ago
Joined: 09/17/2015
Posts: 53
Mono + C# + (CMAKE)

Hello,

EDIT:

While I am still interested in the question below we worked around this problem. But now I'd like to use our C# application under Linux as well.

Under Windows, you provide nddsdotnet451.dll. I am missing the equivalent library for Linux / Mono. Can I get this one somewhere? Do I need to compile it myself?

END EDIT.

 

 

I am having a hard time to compile a larger IDL tree to a shared library with Visual Studio 2013/15. With the provided helper tool for rtiddsgen I can create a solution that compiles flawlessly using:

 

C:\Program Files\rti_connext_dds-5.2.0\bin\rtiddsgen.bat C:\Users\***\Projects\idl-***\idl-files\Point.idl -d C:\Users\***\Desktop\point -language C# -create typefiles -create makefiles -platform x64Win64VS2013 

But I have around 50 IDL files I want to compile to a single shared library like I am doing it now under Linux with C++. For that I am using CMAKE. But I cannot CMAKE with C# and VisualStudio to bring to link to DDS. The linker complains that the namespace DDS is not defined.

In CMAKE I am linking like:

ADD_LIBRARY(${TARGET_NAME} 
  ${${TARGET_NAME}_IDL_DATAMODEL}  # Output variable of ADD_IDL_FILES macro
  )


TARGET_LINK_LIBRARIES(${TARGET_NAME} SHARED
  wsock32  ${Connext_LIBRARIES}
  "C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.0/mscorlib.dll" 
   "C:/Program Files/rti_connext_dds-5.2.0/lib/x64Win64VS2013/nddsdotnet451.dll" 
   "C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.0/System.Data.dll"
   "C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.0/System.dll" 
   "C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.0/System.Xml.dll")

IDL_DATAMODEL contains a list of all generated .h* and .c* files generated by rtiddsgen. Connext_LIBRARIES holds a full path to all ndds*.lib files needed. As I said this approach works flawlessly under Windows.

Of course I am also setting all relevant defines:

SET(Connext_DEFINITIONS -DNDDS_USER_DLL_EXPORT -DNDDS_DLL_VARIABLE -DRTI_WIN32 -DWIN32 -DWIN32_LEAN_AND_MEAN)
add_definitions(${Connext_DEFINITIONS})

Is there a better way to manage lots if idl files?

Best regards,

Andreas

 

nddsdotnet451

sara's picture
Offline
Last seen: 1 year 4 months ago
Joined: 01/16/2013
Posts: 128

Hi Andreas,

Sorry for the really late response.

As of today, our .NET libraries depend on CLI which is not fully supported by Mono. There is a request from other customers to change our C# library in a way that it is compatible with non-Windows C# implementations. This was done sucessfully by a customer, so it is feasible. This request, however, is not scheduled yet. If you are still interested, please contact your Account Team to increase the relevance of the feature request and include it in our roadmap.

Thanks,

Sara

Also releated: https://community.rti.com/forum-topic/can-i-use-mono-buildrun-rti-connext-applications