paullouisageneau / libjuice

JUICE is a UDP Interactive Connectivity Establishment library
Mozilla Public License 2.0
403 stars 75 forks source link

Failed to compile on embedded arm architecture platform #208

Closed hqs1 closed 1 year ago

hqs1 commented 1 year ago

Hi, there are some problems with compiling libjuice that seem to be about IPV6 macros and structures.

build error img

Since I'm using cross-compilation, I configured the cross-compilation toolchain

SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_PROCESSOR arm)

SET(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
SET(CMAKE_FIND_ROOT_PATH "/home/hqs/SDK_release/toolchain/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf")

add_compile_options(-fdiagnostics-color=always)
SET(CMAKE_C_FLAGS "-std=c99")

thank you

paullouisageneau commented 1 year ago

Hi, does it compile without the -std=c99 flag? Or do you need the flag for the cross-compilation toochain?

hqs1 commented 1 year ago

Thank you for your answer. The problem has been solved. I added the following flag to compile successfully

set(CMAKE_C_FLAGS "-std=c17 -D__USE_MISC -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112L -w")