如何解决编译错误?
error: undefined reference to 'ntohl'
collect2: error: ld returned 1 exit status
我用的是android-ndk-r10d。
最佳答案
使用 Android NDK 构建时,ntohl
其他用于在网络和主机字节顺序之间进行转换的函数是 #defines
出现在标题中 <sys/endian.h>
.因此,包含该 header 应该可以修复您的编译错误。
关于android - 如何解决Android NDK中的 "undefined reference to ' ntohl'"编译错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32195890/