UE4 boost lib连接错误的解决方法 - 纳金网
联系我们

给我们留言

联系我们

地址:福建省晋江市青阳街道洪山路国际工业设计园纳金网

邮箱:info@narkii.com

电话:0595-82682267

(周一到周五, 周六周日休息)

当前位置:主页 > 3D教程 > 图文教程

UE4 boost lib连接错误的解决方法

来源: 52vr | 责任编辑:传说的落叶 | 发布时间: 2019-06-11 08:27 | 浏览量:

[UE4]boost lib连接错误:LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL'

 

UE4工程的debug模式链接boost的时候出现错误:

UE4  boost error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in 

 

以下是UE4源码的注释,意思是说UE4编译器在编译debug版本的时候仍然会链接release版本的第三方库,因为UE4的编译器不支持在调试debug版本的第三方库。

 

// By default we use the Release C++ Runtime (CRT), even when compiling Debug builds.  This is because the Debug C++

// Runtime isn't very useful when debugging Unreal Engine projects, and linking against the Debug CRT libraries forces

// our third party library dependencies to also be compiled using the Debug CRT (and often perform more slowly.)  Often

// it can be inconvenient to require a separate copy of the debug versions of third party static libraries simply

// so that you can debug your program's code.

bDebugBuildsActuallyUseDebugCRT = false;

内容转自:https://forums.unrealengine.com/showthread.php?63340-Building-engine-with-Debug-Runtime-library

 

解决办法:

最简单的方法就是在构建debug版本时候也去链接release版本的第三方库

 

网上另外一张方法:

MyProject.Build.cs文件的构造方法中添加配置:

C#代码  
  1. BuildConfiguration.bDebugBuildsActuallyUseDebugCRT = true;  

 这样貌似链接boost是可以了,但是又出现其他链接错误:

 error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (__imp_?_Debug_message@std@@YAXPEB_W0I@Z) referenced in function "int __cdecl std::_Atomic_compare_exchange_strong_4(unsigned long volatile *,unsigned long *,unsigned long,enum std::memory_order,enum std::memory_order)" (?_Atomic_compare_exchange_strong_4@std@@YAHPECKPEAKKW4memory_order@1@2@Z)

 

查了一下,论坛上说如果要使用CRT,需要使用源码编译的UE4,因为目前版本对VS2015支持还不完善,有时间了再尝试下。

详情见:https://answers.unrealengine.com/questions/294191/vs2015-linker-errors.html


相关文章
网友评论

您需要登录后才可以发帖 登录 | 立即注册

关闭

全部评论:0条

推荐
热门