Hi All,
I am a newbie to VC++ and this is my first independent project so please pardon my ignorance!!
My project compiles and runs perfectly fine in Debug mode.
However, when I try to compile it in Release mode ( I need this to use the Setup wizard for application Deployment) I get the following error:
error C4439: 'main' : function definition with a managed type in the signature must have a __clrcall calling convention
I am using the following parameters:
Calling Convention : _stdcall (/Gz)
Common Language Runtime Support (/clr)
Runtime Library: Multi-threaded DLL (/MD)
I have also added the library file ole32.lib in the Additional Dependancies in the Project Property.
When I try to use :
int __clrcall main(array<System::String ^> ^args)
I get the following Link errors:
error LNK2001: unresolved external symbol "extern "C" void __stdcall HidD_GetHidGuid(struct _GUID *)" (?HidD_GetHidGuid@@$$J14YGXPAU_GUID@@@Z)
1>GUI.obj : error LNK2001: unresolved external symbol "extern "C" void * __stdcall SetupDiGetClassDevsA(struct _GUID const *,char const *,struct HWND__ *,unsigned long)" (?SetupDiGetClassDevsA@@$$J216YGPAXPBU_GUID@@PBDPAUHWND__@@K@Z)
1>GUI.obj : error LNK2001: unresolved external symbol "extern "C" int __stdcall SetupDiEnumDeviceInterfaces(void *,struct _SP_DEVINFO_DATA *,struct _GUID const *,unsigned long,struct _SP_DEVICE_INTERFACE_DATA *)" (?SetupDiEnumDeviceInterfaces@@$$J220YGHPAXPAU_SP_DEVINFO_DATA@@PBU_GUID@@
KPAU_SP_DEVICE_INTERFACE_DATA@@@Z)
1>GUI.obj : error LNK2001: unresolved external symbol "extern "C" int __stdcall SetupDiGetDeviceInterfaceDetailA(void *,struct _SP_DEVICE_INTERFACE_DATA *,struct _SP_DEVICE_INTERFACE_DETAIL_DATA_A *,unsigned long,unsigned long *,struct _SP_DEVINFO_DATA *)" (?SetupDiGetDeviceInterfaceDetailA@@$$J224YGHPAXPAU_SP_DEVICE_INTERFACE_DATA@@PAU_SP_DEVICE_INTERFACE_DETAIL_DATA_A@@KPAKPAU_SP_DEVINFO_DATA@@@Z)
1>GUI.obj : error LNK2001: unresolved external symbol "extern "C" unsigned char __stdcall HidD_GetAttributes(void *,struct _HIDD_ATTRIBUTES *)" (?HidD_GetAttributes@@$$J18YGEPAXPAU_HIDD_ATTRIBUTES@@@Z)
1>GUI.obj : error LNK2001: unresolved external symbol "extern "C" int __stdcall SetupDiDestroyDeviceInfoList(void *)" (?SetupDiDestroyDeviceInfoList@@$$J14YGHPAX@Z)
1>GUI.obj : error LNK2001: unresolved external symbol "extern "C" unsigned char __stdcall HidD_SetOutputReport(void *,void *,unsigned long)" (?HidD_SetOutputReport@@$$J212YGEPAX0K@Z)
1>GUI.obj : error LNK2001: unresolved external symbol "extern "C" unsigned char __stdcall HidD_GetInputReport(void *,void *,unsigned long)" (?HidD_GetInputReport@@$$J212YGEPAX0K@Z)
1>GUI.obj : error LNK2001: unresolved external symbol "extern "C" long __stdcall UuidCreate(struct _GUID *)" (?UuidCreate@@$$J14YGJPAU_GUID@@@Z)
1>GUI.obj : error LNK2001: unresolved external symbol "extern "C" long __stdcall UuidToStringA(struct _GUID const *,unsigned char * *)" (?UuidToStringA@@$$J18YGJPBU_GUID@@PAPAE@Z)
1>GUI.obj : error LNK2001: unresolved external symbol "extern "C" long __stdcall RpcStringFreeA(unsigned char * *)" (?RpcStringFreeA@@$$J14YGJPAPAE@Z)
1>C:\Documents and Settings\bandu\My Documents\Visual Studio 2008\Projects\13th July - TES GUI wshid\GUI\Release\GUI.exe : fatal error LNK1120: 11 unresolved externals
Please Help!! :(
Soorali