System.EntryPointNotFound when trying to get C++ method
C# code:
C++ code:
idk what here is wrong
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace CSharpEnd
{
class Program
{
[DllImport("CppEnd.dll")]
static extern int calculate(int x, int y);
static void Main(string[] args)
{
Console.WriteLine(calculate(10, 20));
}
}
}using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace CSharpEnd
{
class Program
{
[DllImport("CppEnd.dll")]
static extern int calculate(int x, int y);
static void Main(string[] args)
{
Console.WriteLine(calculate(10, 20));
}
}
}C++ code:
#include <iostream>
extern "C" int calculate(int x, int y) {
return x * y + y;
}#include <iostream>
extern "C" int calculate(int x, int y) {
return x * y + y;
}idk what here is wrong