Difference between revisions of "YARP and CSHARP"

From Wiki for iCub and Friends
Jump to: navigation, search
Line 1: Line 1:
 
The current supported method for using YARP from C# is via SWIG.  See:
 
The current supported method for using YARP from C# is via SWIG.  See:
   $YARP_ROOT/example/swig
+
   $YARP_ROOT/bindings
  
 
Read the README in that directory.
 
Read the README in that directory.
In the end you should have a project file. Compile it, it will generate a bunch of .cs files.
+
In the end you should have a project file. Compile it, it will generate a bunch of .cs files in the /generated_src directory.
  
Create the directory /YarpCS and move all the .cs files in this directory
+
Create the directory /YarpCS
 
Open Visual Studio and start a new Classes Library project named YarpCS in /YarpCS.
 
Open Visual Studio and start a new Classes Library project named YarpCS in /YarpCS.
  

Revision as of 17:04, 28 February 2013

The current supported method for using YARP from C# is via SWIG. See:

 $YARP_ROOT/bindings

Read the README in that directory. In the end you should have a project file. Compile it, it will generate a bunch of .cs files in the /generated_src directory.

Create the directory /YarpCS Open Visual Studio and start a new Classes Library project named YarpCS in /YarpCS.

From this project, remove the "Class1.cs" generated by visual studio and add all the .cs file generated by swig earlier.

Generate the solution.

It will product a file called YarpCS.dll, this is the dll that your CS project will reference.

Try to create a new project, click on add reference and add YarpCS.dll ; intellisense should give you access to Yarp.

Then to run this project you need to have the dll generated by SWIG in your path. This dll should by in /YARP_DIR/example/swig/Release and be called yarp.dll Either add this directory to your path, or move the dll in some place which is in your path.