C
C#3y ago
danilwhale

System.EntryPointNotFound when trying to get C++ method

C# code:
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
2 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
danilwhale
danilwhaleOP3y ago
where i can enable it in project settings?
Want results from more Discord servers?
Add your server