0

I'm trying to read a memory value to use with discord_rpc to add a sort of rich presence pseudo functionality to an existing program.

It seems whenever I try to #include <iostream> it throws a bunch of errors whenever I try to compile code.

Here is some the error:

Error   LNK2038 mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in Discord RPC.obj Discord RPC C:\Users\Joseph\source\repos\Discord RPC\Discord RPC\discord-rpc.lib(discord_rpc.obj)   1   
Error   LNK2038 mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in Discord RPC.obj Discord RPC C:\Users\Joseph\source\repos\Discord RPC\Discord RPC\discord-rpc.lib(discord_rpc.obj)   1   
Error   LNK2038 mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in Discord RPC.obj Discord RPC C:\Users\Joseph\source\repos\Discord RPC\Discord RPC\discord-rpc.lib(discord_register_win.obj)  1   
Error   LNK2038 mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in Discord RPC.obj Discord RPC C:\Users\Joseph\source\repos\Discord RPC\Discord RPC\discord-rpc.lib(discord_register_win.obj)  1   
Error   LNK2038 mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in Discord RPC.obj Discord RPC C:\Users\Joseph\source\repos\Discord RPC\Discord RPC\discord-rpc.lib(serialization.obj) 1   
Error   LNK2038 mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in Discord RPC.obj Discord RPC C:\Users\Joseph\source\repos\Discord RPC\Discord RPC\discord-rpc.lib(serialization.obj) 1   
Error   LNK2038 mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in Discord RPC.obj Discord RPC C:\Users\Joseph\source\repos\Discord RPC\Discord RPC\discord-rpc.lib(rpc_connection.obj)    1   
Error   LNK2038 mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in Discord RPC.obj Discord RPC C:\Users\Joseph\source\repos\Discord RPC\Discord RPC\discord-rpc.lib(rpc_connection.obj)    1   
Warning LNK4098 defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library Discord RPC C:\Users\Joseph\source\repos\Discord RPC\Discord RPC\LINK   1   
Error   LNK1319 8 mismatches detected   Discord RPC C:\Users\Joseph\source\repos\Discord RPC\Debug\Discord RPC.exe  1   

I'm very new to c++ so I have little to no clue what I'm doing wrong.

Here is a pastebin of my full code thus far: https://pastebin.com/N1vnJiXZ I'm also using visual studio 2017

J.Clarke
  • 392
  • 2
  • 15
  • Seems very pertinent, if not a duplicate. https://stackoverflow.com/questions/4080668/iterator-debug-level-value-0-doesnt-match-value-2. – R Sahu Apr 14 '18 at 05:07
  • This is a completely fresh install of visual studio and a fresh copy of the discord library all installed yesterday. I've tried making a new project and re-linking all the library which is about the extent of my trouble shooting ability. – J.Clarke Apr 14 '18 at 05:19
  • 1
    I'm not familiar with newer VSs, but in older ones you were able to switch the runtime library in the project settings. There, you had various choices like static/dynamic linking, singlethreaded/multithreaded and debug/release. Try changing those settings and pay attention whether the error messages change. – Ulrich Eckhardt Apr 14 '18 at 05:25
  • I've messed with the linking and all but I'm VERY new to c++ in general so I'm a little confused as to what that all is though to be clear the project compiles completely fine until I try to include iostream, though if I try to include iostream before stdafx.h then it compiles fine. I need the iostream library for the memory reading part of the program and I can add and compile the memory reading part of the program on it's own in the project fine, it's just when I use discord rpc and iostream in the same program – J.Clarke Apr 14 '18 at 05:29

1 Answers1

0

Seems I was using C code examples to base the discord RPC part of my program off and I don't think C want's to play nicely with C++. Very stupid mistake, though I learnt from it which is what matters.

J.Clarke
  • 392
  • 2
  • 15