© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
85 replies
acookook

❔ Problem with including C DLL in a C# console app project.

So I have this C DLL imported into my console app (.NET 5). I simply cannot get to call it correctly, since everytime I get, something along the lines, that something with the entrypoint is broken, like:
System.EntryPointNotFoundException: 'Unable to find an entry point named 'getCalculatedFitting' in DLL 'BPCalculationDLL.dll'.'
System.EntryPointNotFoundException: 'Unable to find an entry point named 'getCalculatedFitting' in DLL 'BPCalculationDLL.dll'.'

The code with which I am defining this is
[DllImport("BPCalculationDLL.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "getCalculatedFitting")]
        public static extern int getCalculatedFitting(float[] fittinglData, uint length, char ch);
[DllImport("BPCalculationDLL.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "getCalculatedFitting")]
        public static extern int getCalculatedFitting(float[] fittinglData, uint length, char ch);

Honestly I tried a few things, but none of them seem to work in the current VS2022 editor. Does anyone have any idea how import this DLL and call it in another function?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

✅ Using a C# DLL in C++
C#CC# / help
2y ago
Using a c++ dll in c#
C#CC# / help
2y ago
How can I use a precompiled C/C++ dll in a C# project?
C#CC# / help
2y ago
Best practices when using C++ DLL Project interop with C#?
C#CC# / help
2y ago