ireader / media-server

RTSP/RTP/RTMP/FLV/HLS/MPEG-TS/MPEG-PS/MPEG-DASH/MP4/fMP4/MKV/WebM
MIT License
3.05k stars 1.07k forks source link

hls编译出错 #170

Open GuoGuangya opened 2 years ago

GuoGuangya commented 2 years ago

已经编译过SDK库了,在media-server/libhls/demo目录下执行make命令, 报下面的错误,求解答

/usr/include/c++/4.8.2/atomic:1088:66: error: expected initializer before ‘noexcept’
     atomic_fetch_add(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
                                                                  ^
/usr/include/c++/4.8.2/atomic:1093:57: error: expected initializer before ‘noexcept’
     atomic_fetch_add(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
                                                         ^
/usr/include/c++/4.8.2/atomic:1099:43: error: expected initializer before ‘noexcept’
          ptrdiff_t __d, memory_order __m) noexcept
                                           ^
/usr/include/c++/4.8.2/atomic:1105:28: error: expected initializer before ‘noexcept’
          memory_order __m) noexcept
                            ^
/usr/include/c++/4.8.2/atomic:1110:66: error: expected initializer before ‘noexcept’
     atomic_fetch_sub(volatile atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
                                                                  ^
/usr/include/c++/4.8.2/atomic:1115:57: error: expected initializer before ‘noexcept’
     atomic_fetch_sub(atomic<_ITp*>* __a, ptrdiff_t __d) noexcept
                                                         ^
hls-server.cpp: In function ‘int hls_handler(void*, const void*, size_t, int64_t, int64_t, int64_t)’:
hls-server.cpp:85:18: error: ‘atomic_fetch_sub’ is not a member of ‘std’
         if (0 == std::atomic_fetch_sub(&ts->ref, 1) - 1)
                  ^
hls-server.cpp: In function ‘int hls_server_ts_onsend(void*, int, size_t)’:
hls-server.cpp:185:14: error: ‘atomic_fetch_sub’ is not a member of ‘std’
     if (0 == std::atomic_fetch_sub(&ts->ref, 1) - 1)
              ^
hls-server.cpp: In function ‘int hls_server_ts(http_session_t*, const string&, const string&)’:
hls-server.cpp:205:13: error: ‘atomic_fetch_add’ is not a member of ‘std’
             std::atomic_fetch_add(&ts->ref, 1);
ireader commented 2 years ago

gcc什么版本? 看着是std库太旧了。