UE4 C++调试常见错误

一、无法解析的外部符号

error LNK2019: unresolved external symbol “” referenced in function

   解决办法:

  • 检查.build.cs 中是否增加相关模块的引用,或者是否使用 XXX_API 宏

二、没有将“_WIN32_WINNT_WIN10_TH2”定义为预处理器宏,用“0”替换“#if/#elif

error C4668: “_WIN32_WINNT_WIN10_TH2”

   解决办法:添加下面的头文件

#include "Windows/AllowWindowsPlatformTypes.h"
#include "Windows/PreWindowsApi.h"
#include <windows.h> //冲突头文件
#include "Windows/PostWindowsApi.h"
#include "Windows/HideWindowsPlatformTypes.h"

三、无法启动程序D\UE\UE_4.27\Engine\Intermediate\Bulid\Unused\UE4.exe

    解决办法:将项目设置为启动项

 四、打开VS项目里面什么代码也没有

   解决办法:VS生成编译一下

 五、第三方库或者Dll没有加载进入

   解决办法:找打第三方库或者DLL加入

猜你喜欢

转载自blog.csdn.net/qq_43021038/article/details/125484489