thready
asked on
error: Please use the /MD switch for _AFXDLL builds
Hi Experts,
How can I fix this ? I'm using Visual Studio 2008 C++ with MFC.....
Thank you!
Mike
How can I fix this ? I'm using Visual Studio 2008 C++ with MFC.....
Thank you!
Mike
Project->Properties, expand "Configuration Properties" on the left, expand "C/C++", select "Code Generation".
On the right side, click the box next to "Runtime Library" and select "Multithreaded DLL (/MD)" from the combo pulldown.
On the right side, click the box next to "Runtime Library" and select "Multithreaded DLL (/MD)" from the combo pulldown.
ASKER
When I change to this option - it give me this error:
Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
Any ideas?
Thanks,
Mike
What setting to you have in Project->Properties->Confi guration Properties->General in the "Use of MFC" box?
It should say "Use MFC in a Shared DLL".
It should say "Use MFC in a Shared DLL".
>>>> requires MFC shared dll version
It looks as if your MFC app wanted to use static MFC libraries (that is one of the options you have when you create the app using the wizard). Unfortunately that setting conflicts with some header errors.
Try to define the _AFXDLL in the preprocessor macros (simply add the _AFXDLL to the already defined list separated by ;) at C/C++ - preprocessor
It looks as if your MFC app wanted to use static MFC libraries (that is one of the options you have when you create the app using the wizard). Unfortunately that setting conflicts with some header errors.
Try to define the _AFXDLL in the preprocessor macros (simply add the _AFXDLL to the already defined list separated by ;) at C/C++ - preprocessor
> Try to define the _AFXDLL in the preprocessor macros
Setting the "Use of MFC" setting to "Use MFC in a Shared DLL" does this for you.
Setting the "Use of MFC" setting to "Use MFC in a Shared DLL" does this for you.
ASKER
Hmmmm.. I think I might be getting somewhere.... I'm now getting a whole bunch of these errors (having to do with msvcprtd.lib)
Error 77 error LNK2005: "class std::basic_ostream<char,st
Thank you for any further help you can give! Very appreciated!
What is gxinterface.lib? How is gxinterface.lib built?
Brute force solution, not recommended but can work in a pinch:
Project->Properties->Confi guration Properties->Linker->Comman d Line, add "/FORCE:MULTIPLE" to the Additional options box.
Brute force solution, not recommended but can work in a pinch:
Project->Properties->Confi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>>> "/FORCE:MULTIPLE"
The LNK2005 issue often is caused by inconstencies between single-threaded and multi-threaded libraries. In the above case we have different template instantiations and it is good possible that different versions of the STL were used by different libraries. The /FORCE:MULTIPLE could make your app use wrong template instantiations what might lead to unpredictable errors. As wayside said it is not recommended, Hence, don't do it.
The LNK2005 issue often is caused by inconstencies between single-threaded and multi-threaded libraries. In the above case we have different template instantiations and it is good possible that different versions of the STL were used by different libraries. The /FORCE:MULTIPLE could make your app use wrong template instantiations what might lead to unpredictable errors. As wayside said it is not recommended, Hence, don't do it.
That should solve the issue.