Centos7 compiles licode and reports error:'alloc_size' error

1. Error message:

      When centos7 compiles licode, libav always reports alloc_size errors, all warnings being treated as errors all warnings are treated as errors, so many errors will be reported for no reason. Modify the CMakeLists to turn on the warning message, so you don't need to treat the warning as an error.

libdeps/build/include/libavutil/mem.h:174:79: error: ‘alloc_size’ attribute ignored on a function returning ‘int’ [-Werror=attributes]

The solution is to open the file src/erizo/CMakeLists.txt, find CMAKE_CXX_FLAGS, and add -Wno-error.

if(${ERIZO_BUILD_TYPE} STREQUAL "debug")
  message("Generating DEBUG project")
  set(CMAKE_CXX_FLAGS "-g -Wall  -std=c++14 ${ERIZO_CMAKE_CXX_FLAGS} -Wno-error")
elseif(${ERIZO_BUILD_TYPE} STREQUAL "sanitizer")
    message("Generating SANITIZER project")
    set(CMAKE_CXX_FLAGS "-g -Wall -std=c++14 ${ERIZO_CMAKE_CXX_FLAGS} -O1 -fno-omit-frame-pointer -fsanitize=address -fno-optimize-sibling-calls")
else()
  mes

Guess you like

Origin blog.csdn.net/lcalqf/article/details/109058323