webrtc-native-examples icon indicating copy to clipboard operation
webrtc-native-examples copied to clipboard

Windows下编译显示缺少头文件

Open LiangJunqiang opened this issue 1 year ago • 1 comments

在Windows下使用改写的命令编译src\data-channel: clang++ main.cpp libwebrtc.a -I ../../third_party/webrtc/ -I ../../third_party/webrtc/third_party/abseil-cpp/ -DWEBRTC_POSIX -lpthread -ldl 报错:

In file included from main.cpp:8:
In file included from ../../third_party/webrtc\api/create_peerconnection_factory.h:19:
In file included from ../../third_party/webrtc\api/peer_connection_interface.h:82:
In file included from ../../third_party/webrtc\api/async_dns_resolver.h:18:
In file included from ../../third_party/webrtc\rtc_base/socket_address.h:20:
../../third_party/webrtc\rtc_base/ip_address.h:15:10: fatal error: 'arpa/inet.h' file not found

静态库webrtc.lib已放到src\data-channel\,webrtc项目的头文件已提取到third_party\webrtc\。 请教一下还需要做什么才能顺利编译?

LiangJunqiang avatar Oct 23 '23 02:10 LiangJunqiang

In Windows you should use -DWEBRTC_WIN instead of -DWEBRTC_POSIX in your build command.

haowxums avatar Dec 01 '23 10:12 haowxums