UE4 编译错误 error C4605

在用VS2015编译UE4的FleX,VXGI等分支的时候,有可能出error C4605的错误。
解决办法是,替换 Engine/Source/Runtime/Core/Public/Windows/WindowsPlatformCompilerSetup.h 中的两行代码,把源代码
**#pragma warning (error: 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4550 4551 4552 4553 4554 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4572 4573 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4593 4594 4595 4596 4597 4598 4599)
#pragma warning (error: 4600 4601 4602 4603 4604 4605 4606 4607 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4693 4694 4695 4696 4697 4698 4699)

替换为#pragma warning (error: 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4550 4551 4552 4553 4554 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4572 4573 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4593 4594 4595 4596 4597 4598 )
#pragma warning (error: 4600 4601 4602 4603 4604 4606 4607 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4693 4694 4695 4696 4697 4698 4699)

再编译就没问题了。

### 关于UE4编译时出现的C1057致命错误 在处理UE4项目中的`fatal error C1057`问题时,通常需要关注以下几个方面: #### 错误描述 `fatal error C1057`通常是由于预处理器文件损坏或不一致引起的。这可能发生在以下情况之一: - 文件编码不匹配。 - 预处理器定义存在冲突。 - 使用了不兼容的第三方库。 此错误的具体原因可能是源码中某些宏定义未被正确解析,或者构建过程中使用的工具链版本与预期不符[^3]。 #### 解决方案 ##### 方法一:清理并重建工程 尝试通过清理整个项目来解决问题。可以执行以下操作: ```bash del /S /Q "$(ProjectDir)\Intermediate\*" del /S /Q "$(ProjectDir)\Binaries\*" ``` 上述命令会删除中间生成文件和二进制输出目录的内容,从而强制重新生成所有必要的文件[^3]。 ##### 方法二:检查依赖项 如果正在链接外部库,则需确认这些库是否已针对当前平台进行了适当配置。例如,在引入C风格导出函数到C++环境中时,可能会遇到符号解析失败的情况。此时应确保头文件中有如下声明: ```cpp #ifdef __cplusplus extern "C" { #endif // 函数原型... #ifdef __cplusplus } #endif ``` 这种做法能够防止名称修饰差异引发的问题[^2]。 ##### 方法三:验证Visual Studio设置 对于Windows上的开发环境而言,Microsoft Visual Studio 的安装及其组件更新状态至关重要。建议按照官方文档指引完成最新补丁应用,并测试不同MSVC Toolset版本之间的切换效果[^4]。 最后提醒开发者仔细阅读完整的编译日志信息,定位具体哪一部分触发了该异常状况后再采取针对性措施。 ```python # 示例Python脚本用于自动化批量清除指定路径下的临时数据 import os def clean_intermediate_files(base_path): intermediate_dir = os.path.join(base_path, 'Intermediate') binaries_dir = os.path.join(base_path, 'Binaries') for dir_to_clean in [intermediate_dir, binaries_dir]: if os.path.exists(dir_to_clean): for root, dirs, files in os.walk(dir_to_clean): for file_name in files: try: os.remove(os.path.join(root, file_name)) except Exception as e: print(f'Failed to delete {file_name}: {e}') if __name__ == '__main__': project_root = r'C:\Your\UE4ProjectPath' clean_intermediate_files(project_root) ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值