038 error when using static library containing ?! Has anyone linked a static library that use vectors?

You are linking a library built in Debug (so against Debug standard libs) with an engine built in Development (which links against Release standard libs). Those libraries are not binary compatible.

I have created a static library which uses vector<> which keeps throwing up errors when I try to build. Initially I had an issue with the Debug_iterator_level being 2 instead of 0 which I fixed by changing in manually. However now I am getting the following error:

Error	LNK2038	mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in SharedPCH.Engine.h.obj	TheTable	C:\Users\\Documents\Unreal Projects\03_BuildingEscape\TheTable\Intermediate\ProjectFiles\MathFuncsLib.lib(MathFuncsLib.obj)	1	

Interestingly, when I remove all instances of stl vector<> from my static library and then link it, the project manages to build fine. Does anyone know what could be causing this issue?

Thanks for your reply! Although when I change from debug to release I get a new error:

Error	C1900	Il mismatch between 'P1' version '20161212' and 'P2' version '20150812'	TheTable	C:\Users\\Documents\Unreal Projects\03_BuildingEscape\TheTable\Intermediate\ProjectFiles\EXEC	1	

Any chance you know where this is coming from? I am using the same version of VS 2017 for unreal and to create my static library. It may be better if I ask this as a standalone question for anyone else having similar issues.

For Microsoft compiler, the library needs to be compiled with exactly the same compiler version as the engine. Make sure that you are using Visual Studio 2015 Update 3 for compiling the library.

Thank you, using VS 2015 update 3 fixed my problem