-3

I have recently using jsoncpp in my mfc project and it works fine.But when i trying to compiling the project with /clr and i got linker error below :

1>lib_json.lib(json_writer.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Brusher.obj

1>lib_json.lib(json_value.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Brusher.obj

1>lib_json.lib(json_reader.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in Brusher.obj

1>lib_json.lib(json_writer.obj) : error LNK2001: unresolved external symbol "__int64 const std::_BADOFF" (?_BADOFF@std@@3_JB)

1>lib_json.lib(json_writer.obj) : error LNK2001: unresolved external symbol "public: static class std::locale::id std::ctype::id" (?id@?$ctype@D@std@@2V0locale@2@A)

1>lib_json.lib(json_writer.obj) : error LNK2001: unresolved external symbol "private: static int std::locale::id::_Id_cnt" (?_Id_cnt@id@locale@std@@0HA)

How would I fix this?

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
coder
  • 163
  • 2
  • 3
  • 12
  • 1
    You cannot link a static library that was built with /MT. You must rebuild the library with /MD, rock-hard requirement for C++/CLI. – Hans Passant Jan 16 '15 at 16:33
  • Thank you @HansPassant,i have rebuild the jsoncpp library with /MD and its working...and i realize that is a obviously stupid question.. – coder Jan 17 '15 at 03:31
  • thanks again dude,thank you to help me fixed this. but i wound how much people would use the managed code in c++?in what kind of situation? – coder Jan 17 '15 at 03:36

1 Answers1

1

i don't know how to mark a comment as a answer and here is the answer by @Hans Passant:

You cannot link a static library that was built with /MT. You must rebuild the library with /MD, rock-hard requirement for C++/CLI. – Hans Passant 11 hours ago

and what i did is rebuild the jsoncpp library with /MD and its working.

coder
  • 163
  • 2
  • 3
  • 12