Creating a cross platform

shared library with RemObjects C#

Targetting Java, .NET and OSX

Created by Carlo Kok

 

Use the left/right arrows to move to the next page, single page version here.

Requirements

  • A recent RemObjects C#
  • A Mac
  • The Java SDK
  • Visual Studio

Step one: .NET

  • Create a new RemObjects C# for .NET project, make sure to select Solution in it's own folder
  • Add a reference to Sugar
  • Add the code to be shared to the source file

Add the code to be shared to the source file

Step two: Move the source in a directory

  • Create a new "Source" directory in your solution folder and move the cs file
  • Remove and re-add it to the project as a link

Step three: Java

  • Add a new RemObjects C# for Java project to the existing solution
  • Add a reference to Sugar
  • Add the cs file as a link

Step four: Compile

  • Compile
  • Notice things that need changing, the using list and "string" needs to become "String".

Step five: Cocoa

  • Add a new RemObjects C# for Cocoa project to the existing solution
  • Add a reference to Sugar
  • Add the cs file as a link

Step six: Compile

  • Compile
  • Switch to the OSX project
  • Correct the error: Add the elif for Nougat

Step seven: Compile again

  • Compile

Done

You now have 3 shared libraries with the same code and a minimal number of ifdefs