So i was following the solution posted in this question
Calling a C# library from python
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using RGiesecke.DllExport;
class Test
{
[DllExport("add", CallingConvention = CallingConvention.Cdecl)]
public static int TestExport(int left, int right)
{
return left + right;
}
}
Python
import ctypes
a = ctypes.cdll.LoadLibrary('ClassLibrary1.dll')
a.add(3, 5)
Error
AttributeError: function 'add' not found
What i did was to copy the dll onto desktop and run a python shell in desktop and run the following lines in the python shell. Am i doing something wrong?
I am using python 2.7