c - DLL function not exported: Unable to find an entry point named TestFunc -


I am busy knowing a small bit of C / C ++, and I have a simple interop with C # Win32 DLL has tested and tested many examples of using this from C #, but when I try and call in my DLL, I get a runtime error: "Unable to find an entry point named TestFunc" My DLL looks like this, and I made it from a Win32 DLL project, down With Riojana options:

Header:

  __ declspec (dllexport) int TestFunc (char *, char *, char *);  

code file:

  #include "stdafx.h" #Include "TestLib.h" __declspec (dllexport) Int Testfnks (char * arg1, char * Arg2, char * arg3) {char str1 [] = "Brady Kelly"; Four str2 [] = "hello world"; Four strokes [] = "1234567890"; Strcpy (arg1, str1); Return 128; }  

What am I doing?

Is your work compiled using C or C + binding? You do not specify, but it looks like this to me, as if there is a possibility that you are using the C ++ compiler - Compiler uses a very different name mangling from the compiler and you find the name "TestFunc" As if you were using C compiler or using the C-name mangling rules.

To use the C + mangling rules, simply tell the C ++ compiler, use it in the header file:

  External "C" {__declspec (dllexport) Int TestFunc (four *, four *, four *); }  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -