How to Present a C Static Library (.lib) through VC++ Class Library Proj
Hi,
I am attempting to present a pretty complicated API (C Static Libraries w/headers) to my C# application. I have found another useful example using C++ Libraries athttp://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=970907&SiteID=1&mode=1 but after getting involved, it appears there may be some important differences.
Firstly (in a VC++ Class Library Project), I have added the .lib files to the Linkers "additional dependencies" and removed the (INHERIT) macro from that directive. I then create my ref class using the convention (for example):
int managedCall(NativeType1 param, NativeType2 param2, unsigned char param3)
{
return __API_NAMESPACE::nativeCall(param, param2, param3;
}
(note that these APIs must accept parameter types I have not defined! I am not sure how I am going to deal with this yet.
When I attempt to compile my project, I get many, many LNK errors, mostly in the exact sample template:
LNK2028: unresolved token *int __cdecl nativeCall(param, param,) etc etc etc.
and
LNK2019: unresolved external symbol *int _cdecl etc etc refernced in function etc etc.
I can give the details of these errors if necessary, but I don't think it will help. Note that the calls are being done with the _cdecl keyword, is this an issue? Any insight into this issue would be greatly appreciated.
Thanks,
Kevin

