fpagliughi / sockpp

Modern C++ socket library.
BSD 3-Clause "New" or "Revised" License
769 stars 126 forks source link

Android compilation is broken with recent NDK (strerror_r) #85

Open SirLynix opened 1 year ago

SirLynix commented 1 year ago

Hi,

It looks like strerror_r changed on Android between SDK versions, sockpp compiles fine with SDK 21 but compilation fails with SDK 29 with the same error as #52.

[ 54%] Building CXX object src/CMakeFiles/sockpp-objs.dir/inet6_address.cpp.o
cd /home/runner/.xmake/cache/packages/2307/s/sockpp/v0.8.1/source/build_d7deac03/src && /home/runner/work/xmake-repo/xmake-repo/android-ndk-r22/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi29 --gcc-toolchain=/home/runner/work/xmake-repo/xmake-repo/android-ndk-r22/toolchains/llvm/prebuilt/linux-x86_64 --sysroot=/home/runner/work/xmake-repo/xmake-repo/android-ndk-r22/toolchains/llvm/prebuilt/linux-x86_64/sysroot  -I/home/runner/.xmake/cache/packages/2307/s/sockpp/v0.8.1/source/include -I/home/runner/.xmake/cache/packages/2307/s/sockpp/v0.8.1/source/build_d7deac03/generated/include -I/home/runner/.xmake/cache/packages/2307/s/sockpp/v0.8.1/source/src -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security   -Oz -DNDEBUG  -fPIC -Wall -Wextra -Wpedantic -Wdocumentation -MD -MT src/CMakeFiles/sockpp-objs.dir/inet6_address.cpp.o -MF CMakeFiles/sockpp-objs.dir/inet6_address.cpp.o.d -o CMakeFiles/sockpp-objs.dir/inet6_address.cpp.o -c /home/runner/.xmake/cache/packages/2307/s/sockpp/v0.8.1/source/src/inet6_address.cpp
/home/runner/.xmake/cache/packages/2307/s/sockpp/v0.8.1/source/src/exception.cpp:71:9: error: cannot initialize a variable of type 'int' with an rvalue of type 'char *'
                                int e = strerror_r(err, buf, sizeof(buf));
                                    ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Full error log: https://github.com/xmake-io/xmake-repo/actions/runs/5475705045/jobs/9972184478?pr=2284

waruqi commented 1 year ago

https://github.com/fpagliughi/sockpp/pull/86