OpenHarmony开发者论坛

标题: 编译支持OH的flutter_engine时出现错误 [打印本页]

作者: anlimin    时间: 2023-11-18 11:04
标题: 编译支持OH的flutter_engine时出现错误
../../third_party/dart/runtime/bin/socket_base_posix.cc:263:33: error: comparison of integers of different signs: 'unsigned long' and 'long' [-Werror,-Wsign-compare]
         i++, message++, cmsg = CMSG_NXTHDR(&msg, cmsg)) {
                                ^~~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/work/engine/ndk/linux/4.0/native/sysroot/usr/include/sys/socket.h:360:44: note: expanded from macro 'CMSG_NXTHDR'
        __CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
[122/8624] CXX obj/flutter/third_party/tonic/file_loader/tonic.file_loader_posix.o
ninja: build stopped: subcommand failed.
作者: westinyang    时间: 2023-11-18 11:20
[md]忽略编译警告,重新编译,修改 engine/src/build/config/compiler/BUILD.gn

```
# 搜索 default_warning_flags = 修改为下面的代码
# line 602 603
default_warning_flags = ["-Wno-sign-compare"]
default_warning_flags_cc = ["-Wno-sign-compare"]
```

[/md]
作者: Desto    时间: 2023-11-18 11:31
这个叫你去看socket_base_posix.cc的263行,unsigned long和long不能比较,你把两个改成同样类型试试




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5