473,729 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DllCanUnloadNow linking error?

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:\NewUIPackers 1\drivers\Unser \bin\WIN32\DEBU G\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 DllGetClassObje ct
UIDLL.def : error LNK2001: unresolved external symbol DllRegisterServ er
UIDLL.def : error LNK2001: unresolved external symbol
DllUnregisterSe rver
UIDLL.def : error LNK2001: unresolved external symbol getDevIC
G:\NewUIPackers 1\drivers\Unser \bin\WIN32\DEBU G\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 DllGetClassObje ct(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
extern "C" HRESULT __stdcall DllGetClassObje ct(REFCLSID rclsid, REFIID
riid, LPVOID* ppv)
{
AFX_MANAGE_STAT E(AfxGetStaticM oduleState());

// see if somebody is trying to get one of our published classes
if (SUCCEEDED(_Mod ule.GetClassObj ect(rclsid, riid, ppv)))
return S_OK;

// this may be an MFC request
return AfxDllGetClassO bject(rclsid, riid, ppv);
}

//STDAPI DllCanUnloadNow (void)
extern "C" HRESULT __stdcall DllCanUnloadNow (void)
{
AFX_MANAGE_STAT E(AfxGetStaticM oduleState());

// see if CComModule's instance can unload
if ( _Module.GetLock Count() == 0 )
return S_FALSE;

// see if MFC's COM can unload
if ( SUCCEEDED(AfxDl lCanUnloadNow() ) )
return S_FALSE;

return S_OK;
}

// by exporting DllRegisterServ er, you can use regsvr.exe
//STDAPI DllRegisterServ er(void)
extern "C" HRESULT __stdcall DllRegisterServ er(void)
{
AFX_MANAGE_STAT E(AfxGetStaticM oduleState());

if (!COleObjectFac toryEx::UpdateR egistryAll(TRUE ))
return ResultFromScode (SELFREG_E_CLAS S);

return _Module.Registe rTypeLib();

}
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.

Jul 22 '05 #1
3 14542
> 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:\NewUIPackers 1\drivers\Unser \bin\WIN32\DEBU G\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 DllGetClassObje ct
UIDLL.def : error LNK2001: unresolved external symbol DllRegisterServ er
UIDLL.def : error LNK2001: unresolved external symbol
DllUnregisterSe rver
UIDLL.def : error LNK2001: unresolved external symbol getDevIC
G:\NewUIPackers 1\drivers\Unser \bin\WIN32\DEBU G\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 DllGetClassObje ct(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
extern "C" HRESULT __stdcall DllGetClassObje ct(REFCLSID rclsid, REFIID
riid, LPVOID* ppv)
{
AFX_MANAGE_STAT E(AfxGetStaticM oduleState());

// see if somebody is trying to get one of our published classes
if (SUCCEEDED(_Mod ule.GetClassObj ect(rclsid, riid, ppv)))
return S_OK;

// this may be an MFC request
return AfxDllGetClassO bject(rclsid, riid, ppv);
}

//STDAPI DllCanUnloadNow (void)
extern "C" HRESULT __stdcall DllCanUnloadNow (void)
{
AFX_MANAGE_STAT E(AfxGetStaticM oduleState());

// see if CComModule's instance can unload
if ( _Module.GetLock Count() == 0 )
return S_FALSE;

// see if MFC's COM can unload
if ( SUCCEEDED(AfxDl lCanUnloadNow() ) )
return S_FALSE;

return S_OK;
}

// by exporting DllRegisterServ er, you can use regsvr.exe
//STDAPI DllRegisterServ er(void)
extern "C" HRESULT __stdcall DllRegisterServ er(void)
{
AFX_MANAGE_STAT E(AfxGetStaticM oduleState());

if (!COleObjectFac toryEx::UpdateR egistryAll(TRUE ))
return ResultFromScode (SELFREG_E_CLAS S);

return _Module.Registe rTypeLib();

}
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.


You need to change the LINKER settings. The linker cannot find the import
library for these functions. That is what it "unresolved external" means.
Jul 22 '05 #2
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.


Linking is off-topic in comp.lang.c++ . Just C++ is discussed here.
I would suggest reposting in a Microsoft VC newsgroups.

SH
Jul 22 '05 #3
Hi,

If you use uuid.lib in combination with other .lib files that define
GUIDs (for example, oledb.lib and adsiid.lib). For example:
oledb.lib(oledb _i.obj) : error LNK2005: _IID_ITransacti onObject
already defined in uuid.lib(go7.ob j)
To fix, add /FORCE:MULTIPLE to the linker command line options, and
make sure that uuid.lib is the first library referenced.
Saurabh Aggrawal

Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1721
by: Wolfgang | last post by:
I have a problem with linking my CPP Code under a irix6 machine (sgi, UNIX). In my CPP code I use some Functions which are written in Python. So its a kind of CPP wrapper for my Python functions In my Python Code I use threads to communicate over the network and stuff like this. Compilation and linking are working very well under Windows and Linux with the same code. Under the sgi, UNIX machine some errors occur and I don't no why....
7
6553
by: wmkew | last post by:
Hello everyone I'm encountering a R6002 Runtime error and several bugs when trying to generate a simple Managed C++ application with .NET 2003. The main problem seems to arise from linking with LIBCMT(D).DLL. (My requirement is that we can't link with MSVCRT(D).LIB.) Below are steps I've followed, and the resulting problems 1. Using the New Project wizard, generate a Visual C++ .NET Class Library project (call it "Doomed") and a VC++...
1
9484
by: Kay | last post by:
I already specified to ignore specific library: MSVCPRT.lib MSVCRT.lib LIBC.lib MSVCRTD.lib LIBCD.lib command line is like: /INCREMENTAL /NOLOGO /DLL /NODEFAULTLIB:"MSVCPRT.lib MSVCRT.lib LIBC.lib MSVCRTD.lib LIBCD.lib" but I am still getting conflict linking problems. But if I do specify /NODEFAULTLIB, I'll get anther bunch of linking errors. Anybody knows why? thanks,
4
2436
by: Ralf Hoelzemer | last post by:
hi list, the sdk of a program i am writing a plugin for says: " The dll project implementing the COM object must implement and export the DllCanUnloadNow function in order to be freed by UnloadCOMLibs. See your compiler documentation for more details about DllCanUnloadNow. " is it possible to export "DllCanUnloadNow" from a vb.net class library and if yes - how would i do this ?
4
6403
by: Sanjay Kumar | last post by:
Folks ! I am working with VC++ after a long time and having problem linking latest xerces 2.7 in VC++ 2005 Express Edition. I have done following: 1. downloaded and unpacked the the library: http://www.apache.org/dist/xml/xerces-c/binaries/xerces-c_2_7_0-windows_2000-msvc_60.zip
0
2557
by: Philip Lowman | last post by:
I am in the process of trying to migrate a couple of build solutions to Visual Studio Express 2005 from VS 2003 Professional and I am running into a weird C/C++ runtime library linking issue when using the /MT compilation option. Our debug solution's /MTd flag works fine and using /MD also seems to work ok. For some reason I can't fathom, when I use /MT, linking the static excutable completely dies (problems resolving symbols in the STL,...
1
6437
by: Vishu7 | last post by:
Hi, I am porting my code which is written in VC2005( c++) to WinCE 5.0. When i build my project i get this error AACDec.def : error LNK2001: unresolved external symbol DllCanUnloadNow AACDec.def : error LNK2001: unresolved external symbol DllGetClassObject i have include all necessary library and include files. I didn't this type of in VS2005 (c++), please anyone who have worked directshow in wince , help.
0
3981
by: xieml2007 | last post by:
Dear Madam or Sir, I encountered one problem which is quite similiar to the discussions launched at the web site: http://www.thescripts.com/forum/thread280324.html
0
2969
by: dotyet | last post by:
Hi Everyone, I am trying to build a DB2 UDB UDF which can perform regex over the table data. The user defined function will call an external .dll file to do the task. I am referring to the following link for doing so: http://www.ibm.com/developerworks/db2/library/techarticle/0301stolze/0301stolze.html While linking the below mentioned code, I am facing some errors. I have installed PCRE and am using Visual C++ 6.0 in 32-bit mode. The
0
8928
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9291
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9158
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6026
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4535
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4799
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3244
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2698
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.