现在的位置: 首页 > 综合 > 正文

将UE4代码编译成32位的编辑器

2018年03月15日 ⁄ 综合 ⁄ 共 739字 ⁄ 字号 评论关闭

UE4的编辑器在windows平台是不支持32位的,直接选择Developer_Editor  Win32编译之后会产生以下编译错误:

C2917,"parameter”: 具有 __declspec(align('8')) 的形参将不被对齐


以下是MSDN的解释:

错误消息

“parameter”: 具有 __declspec(align('#')) 的形参将不被对齐

函数参数中不允许使用 align__declspec 修饰符。

下面的示例生成 C2719:

// C2719.cpp
void func(int __declspec(align(32)) i);   // C2719
// try the following line instead
// void func(int i);

事实上,MS编译器目前还不支持函数参数对齐。

而UE4的FVector4类使用了对齐:

MS_ALIGN(16) class FVector4

在使用FVector4作为参数的函数中我们更改参数为引用形式:

static
FVector4 AttemptToSnapLocationToOriginPlane( const FViewportCursorLocation& Cursor,FVector4 Location )    //C2719

更改为:

static
FVector4 AttemptToSnapLocationToOriginPlane( const FViewportCursorLocation& Cursor,const FVector4& Location )   //ok

基本上按照这个模式 可以处理所有C2719错误。

下面处理链接错误:一般错误都为缺少32位的第三方库文件。可以在ThirdParty内修改对应的build.cs文件,添加对Win32平台的配置。

抱歉!评论已关闭.