My algorithm contains C and asm code. I need to call this algorithm in a C# application. I was wondering if I could convert the C and asm code to a DLL and then call it in the C# console application. But I'm very unclear about how to convert the coupled C and asm code algorithm into a DLL. Any help is appreciated.
I know how to use PInvoke to call the DLL in C#. My issue is converting the combined C and asm code to a DLL. VS 2010 keeps vomitting errors when I try to use extern "C" and dllexport. There are over 90 errors!! Most of the errors are those complaining that C++ doesn't support the stuff I've used(though they are valid in C). Like for example, this line of code:
const u8 *error_string_base="ERROR: ";
gives an
error C4430: missing type specifier -int assumed. Note C++ does not support default-int
Yes, you can call unmanaged code that is in a DLL from C#.
http://msdn.microsoft.com/en-us/library/aa288468(v=vs.71).aspx
You'll probably want to have a look at the topic Calling a DLL Export Directly from C#
http://msdn.microsoft.com/en-us/library/aa288468(v=vs.71).aspx#pinvoke_callingdllexport
UPDATE (Based on your edit)
Compile your application in C mode rather than C++ mode
Go to properties -> c/c++ ->advanced -> compile as and select 'c'