GCC版本:
gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1)
1、编译libsrtp-2-fit的错误:
gcc -DHAVE_CONFIG_H -Icrypto/include -I./include -I./crypto/include -fPIC -Wall -pedantic -Wstrict-prototypes -O4 -fexpensive-optimizations -funroll-loops -I/home/wbin/work/huawei_rtc/srs-4.0.156/trunk/objs/Platform-Linux-5.11.0-GCC10.3.0-SRS4-x86_64/openssl-1.1-fit/_release/include -I./test -L. -o crypto/test/datatypes_driver crypto/test/datatypes_driver.c test/util.c libsrtp2.a -L/home/work/srs-4.0.156/trunk/objs/Platform-Linux-5.11.0-GCC10.3.0-SRS4-x86_64/openssl-1.1-fit/_release/lib -lcrypto -ldl -lsrtp2
/usr/bin/ld: libsrtp2.a(datatypes.o):(.bss+0x0): multiple definition of `bit_string'; /tmp/ccbkWd0W.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:215: crypto/test/datatypes_driver] Error 1
解决办法:修改文件./objs/Platform-Linux-5.11.0-GCC10.3.0-SRS4-x86_64/libsrtp-2-fit/crypto/math/datatypes.c 中 char bit_string[MAX_PRINT_STRING_LEN]; 加上static
编译通过
2、编译openssl-1.1-fit错误:
gcc -DHAVE_CONFIG_H -Icrypto/include -I./include -I./crypto/include -fPIC -Wall -pedantic -Wstrict-prototypes -O4 -fexpensive-optimizations -funroll-loops -I/home/work/srs-4.0.156/trunk/objs/Platform-Linux-5.11.0-GCC10.3.0-SRS4-x86_64/openssl-1.1-fit/_release/include -I./test -L. -o crypto/test/datatypes_driver crypto/test/datatypes_driver.c test/util.c libsrtp2.a -L/home/work/srs-4.0.156/trunk/objs/Platform-Linux-5.11.0-GCC10.3.0-SRS4-x86_64/openssl-1.1-fit/_release/lib -lcrypto -ldl -lsrtp2
/usr/bin/ld: libsrtp2.a(datatypes.o):(.bss+0x0): multiple definition of `bit_string'; /tmp/ccdbuJWe.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:215: crypto/tes
解决办法:修改文件vim ./3rdparty/libsrtp-2-fit/crypto/math/datatypes.c char bit_string[MAX_PRINT_STRING_LEN]; 加上static
configure通过!