项目场景:
BasicTaskScheduler.cpp:191:40: error: ‘struct std::atomic_flag’ has no member named ‘test’
问题描述
linux编译live555最新版本,出现报错。
原因分析:
The current repository source is the 06.14 version, but I downloaded the 06.20 version source from the live555 official website and confirmed the same build error.
If you are 06.20 version, the problem is:
test variable in atomic_flag is a feature supported by c++20. If your compiler fully supports c++20, you can just use the -std=c++20 or -std=c++2a option to solve the problem. However, this may not work if your compiler does not fully support c++20.If that’s the case, just build by adding the -DNO_STD_LIB option. I
solved the problem this way.NO_STD_LIB macro was added in 06.16 version and more details can be
found here: http://www.live555.com/liveMedia/public/changelog.txt
解决方案:
issue链接:openrtsp 2023.06.16 build issue #45
my env is Ubuntu20.04 and live.2023.07.24.tar.gz, so i edit the
config.linux-64bit, Added -DNO_STD_LIB at the end of the first line,
Modify to
COMPILE_OPTS = $(INCLUDES) -m64 -fPIC -I/usr/local/include
-I. -O2 -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DNO_STD_LIB