S
Saurabh Aggrawal
Hi,
I am porting an application for 64-bit AMD processor and while linking
the application i am getting the following errors:
Processing directory uidll...
Linking DLL G:\NewUIPackers1\drivers\Unser\bin\WIN32\DEBUG\PPKAW1UI.dll
....
LINK : warning LNK4224: /PDBTYPE is no longer supported; ignored
UIDLL.def : error LNK2001: unresolved external symbol DllCanUnloadNow
UIDLL.def : error LNK2001: unresolved external symbol DllGetClassObject
UIDLL.def : error LNK2001: unresolved external symbol DllRegisterServer
UIDLL.def : error LNK2001: unresolved external symbol
DllUnregisterServer
UIDLL.def : error LNK2001: unresolved external symbol getDevIC
G:\NewUIPackers1\drivers\Unser\bin\WIN32\DEBUG\PPKAW1UI.lib : fatal
error LNK1120: 5 unresolved externals
LINK : fatal error LNK1141: failure during build of exports file
NMAKE : fatal error U1077: 'link' : return code '0x475'
Stop.
NMAKE : fatal error U1077: 'for' : return code '0x2'
Stop.
I have included the all the paths correctly.
Below is the declarations for the functions the error is in:
//STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
extern "C" HRESULT __stdcall DllGetClassObject(REFCLSID rclsid, REFIID
riid, LPVOID* ppv)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// see if somebody is trying to get one of our published classes
if (SUCCEEDED(_Module.GetClassObject(rclsid, riid, ppv)))
return S_OK;
// this may be an MFC request
return AfxDllGetClassObject(rclsid, riid, ppv);
}
//STDAPI DllCanUnloadNow(void)
extern "C" HRESULT __stdcall DllCanUnloadNow(void)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// see if CComModule's instance can unload
if ( _Module.GetLockCount() == 0 )
return S_FALSE;
// see if MFC's COM can unload
if ( SUCCEEDED(AfxDllCanUnloadNow()) )
return S_FALSE;
return S_OK;
}
// by exporting DllRegisterServer, you can use regsvr.exe
//STDAPI DllRegisterServer(void)
extern "C" HRESULT __stdcall DllRegisterServer(void)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
return ResultFromScode(SELFREG_E_CLASS);
return _Module.RegisterTypeLib();
}
I have tried the return types for the functions both STDAPI and extern
"C" HRESULT __stdcall but still the error is there. What further
changes i am should do to remove these linking errors.
I am porting an application for 64-bit AMD processor and while linking
the application i am getting the following errors:
Processing directory uidll...
Linking DLL G:\NewUIPackers1\drivers\Unser\bin\WIN32\DEBUG\PPKAW1UI.dll
....
LINK : warning LNK4224: /PDBTYPE is no longer supported; ignored
UIDLL.def : error LNK2001: unresolved external symbol DllCanUnloadNow
UIDLL.def : error LNK2001: unresolved external symbol DllGetClassObject
UIDLL.def : error LNK2001: unresolved external symbol DllRegisterServer
UIDLL.def : error LNK2001: unresolved external symbol
DllUnregisterServer
UIDLL.def : error LNK2001: unresolved external symbol getDevIC
G:\NewUIPackers1\drivers\Unser\bin\WIN32\DEBUG\PPKAW1UI.lib : fatal
error LNK1120: 5 unresolved externals
LINK : fatal error LNK1141: failure during build of exports file
NMAKE : fatal error U1077: 'link' : return code '0x475'
Stop.
NMAKE : fatal error U1077: 'for' : return code '0x2'
Stop.
I have included the all the paths correctly.
Below is the declarations for the functions the error is in:
//STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
extern "C" HRESULT __stdcall DllGetClassObject(REFCLSID rclsid, REFIID
riid, LPVOID* ppv)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// see if somebody is trying to get one of our published classes
if (SUCCEEDED(_Module.GetClassObject(rclsid, riid, ppv)))
return S_OK;
// this may be an MFC request
return AfxDllGetClassObject(rclsid, riid, ppv);
}
//STDAPI DllCanUnloadNow(void)
extern "C" HRESULT __stdcall DllCanUnloadNow(void)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// see if CComModule's instance can unload
if ( _Module.GetLockCount() == 0 )
return S_FALSE;
// see if MFC's COM can unload
if ( SUCCEEDED(AfxDllCanUnloadNow()) )
return S_FALSE;
return S_OK;
}
// by exporting DllRegisterServer, you can use regsvr.exe
//STDAPI DllRegisterServer(void)
extern "C" HRESULT __stdcall DllRegisterServer(void)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
return ResultFromScode(SELFREG_E_CLASS);
return _Module.RegisterTypeLib();
}
I have tried the return types for the functions both STDAPI and extern
"C" HRESULT __stdcall but still the error is there. What further
changes i am should do to remove these linking errors.