Inquiridor
finding error --error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug'

Pergunta
-
i am trying to build a program and it is showing the following error
error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in vrpn-receiver.obj
i have already tried to changed the runtime library settings .i mean i have applied both 'MD_DynamicRelease' and 'MDd_DynamicDebug' in the runtime library settings , but i do not know why its still showing the same error.
by the way i m using visual studio 2013 express edition
can any one please help out of this
thank you
domingo, 5 de março de 2017 15:02
Todas as Respostas
-
i am trying to build a program and it is showing the following error
error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in vrpn-receiver.obj
i have already tried to changed the runtime library settings .i mean i have applied both 'MD_DynamicRelease' and 'MDd_DynamicDebug' in the runtime library settings , but i do not know why its still showing the same error.
I don't understand what the highlighted comment is trying to convey.
If you want to use the DLL version of the CRT for a debug build then the compiler option should be set to /MDd. If you want a release build then the option should be set to /MD. See https://msdn.microsoft.com/en-us/library/2kzt1wy3(v=vs.120).aspx
Is vrpn-receiver.obj created by your own code or is it coming from a library (.lib) referenced by the project?
- Editado RLWA32 domingo, 5 de março de 2017 16:53 added question
domingo, 5 de março de 2017 15:16 -
thanks for the reply
through the highlighted comment i just want to say that i have already set the compiler option to both /MDd and /MD,but it is not working for me
and the vrpn-reciever.obj is coming from the library(.lib) referenced by the project
so i am still stuck with it, can you please help me out of it
thank you
segunda-feira, 6 de março de 2017 02:57 -
Hi priyam1990,
thanks for posting here.
>>through the highlighted comment i just want to say that i have already set the compiler option to both /MDd and /MD,but it is not working for me
and the vrpn-reciever.obj is coming from the library(.lib) referenced by the project
What do you mean you have already set the compiler option to both /MDd and /MD? How do you do that?
Code that uses one version of the C++ Standard Library or C runtime is incompatible with code that uses a different version. All modules passed to a given invocation of the linker must have been compiled with the same run-time library compiler option.
So please set your application and the modules it references to the same run-time library compiler option, /MDd or /MD.
Hope this could be help of you.
Best Regards,
Sera YuMSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.segunda-feira, 6 de março de 2017 07:26 -
sorry my reply was not clear.....actually i was trying to say that i changed the runtime library settings in properties\c/c++\code generation\runtime library i first used /MDd and then /MD but the issues is not resolved yetsegunda-feira, 6 de março de 2017 14:12
-
Can you create a demo that reliably reproduces the issue and share it on onedrive? This should include the project that builds the library containing vrpn-receiver.obj.
- Editado RLWA32 segunda-feira, 6 de março de 2017 14:18
segunda-feira, 6 de março de 2017 14:17 -
Hi priyam1990,
>>sorry my reply was not clear.....actually i was trying to say that i changed the runtime library settings in properties\c/c++\code generation\runtime library i first used /MDd and then /MD but the issues is not resolved yet
Did you check the vrpn-receiver file's property to see if its property is same as the whole project's property?
Error LNK2038 means a symbol mismatch has been detected by the linker. This error indicates that different parts of an app—this includes libraries or other object code that the app links to—use conflicting definitions of the symbol. You could use detect mismatch pragma to detect their conflicting values.
Hope this could be help of you.
Best Regards,
Sera Yu
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.terça-feira, 7 de março de 2017 02:02 -
Solution for me was to recompile static library(opencv) with matching Configuration/C/C++/All Options/Runtime Library settings between EXE and externally compiled, static library. My EXE is set to /MT(d) and needed to re-compile static library to match; for OpenCV make sure to update all projects, there maybe easier way when generating solution with CMAKE).sexta-feira, 12 de junho de 2020 22:44