sensics / OSVR-RenderManager

Apache License 2.0
64 stars 46 forks source link

Unable to link osvrRenderManager in debug #93

Closed nmanjofo closed 8 years ago

nmanjofo commented 8 years ago

I had issue with linking osvrRenerManager in debug mode:

1>------ Build started: Project: osvrRenderManager, Configuration: Debug x64 ------ 1>jsoncpp.lib(json_value.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in RenderManagerBase.obj 1>jsoncpp.lib(json_value.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in RenderManagerBase.obj 1>jsoncpp.lib(json_reader.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in RenderManagerBase.obj 1>jsoncpp.lib(json_reader.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in RenderManagerBase.obj 1>jsoncpp.lib(json_writer.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in RenderManagerBase.obj 1>jsoncpp.lib(json_writer.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in RenderManagerBase.obj 1> Creating library D:/knihovny/OSVR RenderManager/build64-msvc12/bin/Debug/osvrRenderManagerd.lib and object D:/knihovny/OSVR RenderManager/build64-msvc12/bin/Debug/osvrRenderManagerd.exp 1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library 1>D:\knihovny\OSVR RenderManager\build64-msvc12\bin\Debug\osvrRenderManagerd.dll : fatal error LNK1319: 6 mismatches detected ========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========

Solution - wrong version of jsoncpp.lib was being linked. It should be the debug version of the library and not release. When I updated the project configuration in Visual Studio manually, it linked just fine. I recommend adding Jsoncpp_DEBUG_LIBRARY entry in CMAKE and using that library for debug builds.

russell-taylor commented 8 years ago

@rpavlik Are you up for another round of wrestling with jsoncpp?