|
|
|
|||||
|
Hi,
We build a dll lib with ICE 2.1.0 and VC6.0. Now a MFC messagebox needs to be added in this dll lib. But once we inlude <afxwin.h>, the dll project can't be compiled. The error is: --------------------Configuration: Netids_Connect - Win32 Debug-------------------- Compiling... StdAfx.cpp Compiling... Netids_Connect.cpp QueryServer.cpp QueryServerFactory.cpp Generating Code... Linking... nafxcwd.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in Netids_Connect.obj nafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in MSVCRTD.lib(MSVCRTD.dll) nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in msvcprtd.lib(delop_s.obj) nafxcwd.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in Netids_Connect.obj; second definition ignored nafxcwd.lib(afxmem.obj) : warning LNK4006: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in MSVCRTD.lib(MSVCRTD.dll); second definition ignored nafxcwd.lib(afxmem.obj) : warning LNK4006: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in msvcprtd.lib(delop_s.obj); second definition ignored Creating library Debug/Netids_Connect.lib and object Debug/Netids_Connect.exp nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv nafxcwd.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc nafxcwd.lib(timecore.obj) : error LNK2001: unresolved external symbol __mbctype nafxcwd.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype nafxcwd.lib(apphelp.obj) : error LNK2001: unresolved external symbol __mbctype Debug/Netids_Connect.dll : fatal error LNK1120: 3 unresolved externals Error executing link.exe. Creating browse info file... Netids_Connect.dll - 9 error(s), 3 warning(s) How can I resolve this problem? Is it anything uncomportable between ice stlport and VC6.0? Thank you!
__________________
LiuYing National Research Center for Intelligent Computing Systems(NCIC) Institute of Computing Technology Chinese Academy of Sciences http://www.ncic.ac.cn Our project's name is still in borning, but we call our system DBroker. |
|
|||||
|
I have used /MDd option
The MFC run-time library is "C:\Program Files\Microsoft Visual Studio\VC98\MFC\LIB". When I change above directory to the top of VC library files, the error is less than before. Linking... mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in Netids_Connect.obj mfcs42d.lib(dllmodul.obj) : warning LNK4006: _DllMain@12 already defined in Netids_Connect.obj; second definition ignored Creating library Debug/Netids_Connect.lib and object Debug/Netids_Connect.exp Debug/Netids_Connect.dll : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe. Netids_Connect.dll - 2 error(s), 1 warning(s)
__________________
LiuYing National Research Center for Intelligent Computing Systems(NCIC) Institute of Computing Technology Chinese Academy of Sciences http://www.ncic.ac.cn Our project's name is still in borning, but we call our system DBroker. |
|
|||||
|
I have seen those demos and I use the same flags as them.
There is something different between dll and obj. If I use mfc to create obj, it's OK. But if I use mfc to create dll, the link error will happen. What's wrong with the dll or what especial configuration is needed by dll project?
__________________
LiuYing National Research Center for Intelligent Computing Systems(NCIC) Institute of Computing Technology Chinese Academy of Sciences http://www.ncic.ac.cn Our project's name is still in borning, but we call our system DBroker. |
|
||||||
|
A search on Google gave me this link on the Microsoft web site:
http://support.microsoft.com/default...;en-us;q148652 It looks very similar to your problem! |
|
|||||
|
Hi,
I find something possible to cause the link problem. It is maybe wrong use of _USRDLL and _AFXDLL together. _USRDLL:compiling regular DLLs that statically link to MFC _AFXDLL:compiling regular DLLs that dynamically link to MFC The latter is what we need, so remove _USRDLL in the preprocessor definitions. Now ,compling is OK. I hope the project will work too. I'm so sorry to trouble you. Thank you all for your help very much!
__________________
LiuYing National Research Center for Intelligent Computing Systems(NCIC) Institute of Computing Technology Chinese Academy of Sciences http://www.ncic.ac.cn Our project's name is still in borning, but we call our system DBroker. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| slice2cpp header renaming with header-ext | tctimmeh | Help Center | 2 | 03-28-2009 04:07 PM |
| Project : error PRJ0019: A tool returned an error code: "Performing Custom Build Step | Falagard | Help Center | 6 | 04-11-2004 09:12 PM |
| Ice Php 1.0.2 link error | fengxb | Help Center | 12 | 03-09-2004 12:08 AM |
| link error: error LNK2001: unresolved external symbol __imp___assert | gmueckl | Help Center | 2 | 09-03-2003 02:49 AM |