Dak_Programmer
asked on
Creating a static library from an MFC DLL Project
Is there an easy way to convert an (MFC) Dynamic Link Library into a Static LIB Library???
I have a DLL Project that I need to convert into a Static Link Library...
I have a DLL Project that I need to convert into a Static Link Library...
Create a static project and compare the project's setting (code generation, linking ect..) between them. so you'll know what to change.
Dani
Dani
Do the same thing what KaplanDani sad, but You must change include files from that static projrct to Your project.
See the difference in "stdafx.h" file.
See the difference in "stdafx.h" file.
Hi!
you must remove CWinApp derived objects from your sources to make static library
you must remove CWinApp derived objects from your sources to make static library
ASKER
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _strncpy already defined in libcmtd.lib(strncpy.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in libcmtd.lib(mbctype.obj)
LINK : warning LNK4098: defaultlib "mfc42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcs42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfco42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcd42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcn42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
I am getting these errors when I try to compile my test app... any ideas???
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in libcmtd.lib(mbctype.obj)
LINK : warning LNK4098: defaultlib "mfc42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcs42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfco42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcd42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcn42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
I am getting these errors when I try to compile my test app... any ideas???
ASKER
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _strncpy already defined in libcmtd.lib(strncpy.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in libcmtd.lib(mbctype.obj)
LINK : warning LNK4098: defaultlib "mfc42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcs42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfco42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcd42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcn42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
I am getting these errors when I try to compile my test app... any ideas???
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in libcmtd.lib(mbctype.obj)
LINK : warning LNK4098: defaultlib "mfc42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcs42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfco42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcd42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcn42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
I am getting these errors when I try to compile my test app... any ideas???
Hi!
you must sets same option for using MFC (first tab in tne lib project settings window) as you use in the project where you want use your lib. Note runtime library settings also must be same (dynamic or static, single/multi threaded)
you must sets same option for using MFC (first tab in tne lib project settings window) as you use in the project where you want use your lib. Note runtime library settings also must be same (dynamic or static, single/multi threaded)
ASKER
Ok I did that -- but I still get the following warning...
LINK : warning LNK4098: defaultlib "libcd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "libcd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
ASKER
Ok I did that -- but I still get the following warning...
LINK : warning LNK4098: defaultlib "libcd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "libcd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok I got it working -- but when ever I new an object within the static library -- it seems to give me invalid memory
ASKER
Can there be something wrong with doing a new inside a static library
Shay