1

I need to call CLP (a linear programming solver writen in C++) from C# .net (4.0, 4.5) in VS2013.

 http://www.coin-or.org/Clp/userguide/clpuserguide.html

I have search some links about how to call C++ lib from C#.

I found the possible options:

  1. use the C# warpper

    http://astarte.csr.unibo.it/coinORwrapper/coinORwrapper.htm

  2. Design wrapper class myself.

    http://www.codeproject.com/Articles/19354/Quick-C-CLI-Learn-C-CLI-in-less-than-minutes

    https://msdn.microsoft.com/en-us/library/ms235281%28v=vs.120%29.aspx

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/299da822-5539-4e5b-9ba7-b614e564c9f4/presenting-a-c-library-lib-for-use-in-c-project

CLP has too many classes so I try to avoid writing a wrapper class for each class. This may cause too many errors.

The first option has no English document, and has errors.

Are there other ways to call CLP from C# ?

thanks

Lily
  • 295
  • 1
  • 4
  • 14

1 Answers1

0

As a third option, you have P/Invoke. But that is a mess that you should not get into if you don't know enough C++ to use C++ to call this library.

I don't know what exactly you want to do with CLP, but have you considered using other products that interface better with your language of choice? Could for example the Solver Foundation be an alternative choice?

nvoigt
  • 75,013
  • 26
  • 93
  • 142