cannonbeach / opensrthub

A Linux based SRT hub/gateway service with a statistics reporting web interface for routing audio/video transport stream signals around a network with SRT and UDP
GNU Lesser General Public License v2.1
26 stars 3 forks source link

Compile issue #11

Closed ma-blip closed 6 months ago

ma-blip commented 6 months ago

Having issues compiling. Used the script. Ubuntu 22.04 server

Building opensrthub gcc -g -c -O2 -m64 -Wall -Wfatal-errors -funroll-loops -Wno-deprecated-declarations -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function -Wno-format-truncation -Wno-attributes -Wno-stringop-truncation -I./include -I./cbffmpeg -I./cbsrt/srtcore -I./cbsrt -I./cblibcurl/include/curl ./source/crc.c gcc -g -c -O2 -m64 -Wall -Wfatal-errors -funroll-loops -Wno-deprecated-declarations -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function -Wno-format-truncation -Wno-attributes -Wno-stringop-truncation -I./include -I./cbffmpeg -I./cbsrt/srtcore -I./cbsrt -I./cblibcurl/include/curl ./source/tsdecode.c gcc -g -c -O2 -m64 -Wall -Wfatal-errors -funroll-loops -Wno-deprecated-declarations -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function -Wno-format-truncation -Wno-attributes -Wno-stringop-truncation -I./include -I./cbffmpeg -I./cbsrt/srtcore -I./cbsrt -I./cblibcurl/include/curl ./source/mempool.c gcc -g -c -O2 -m64 -Wall -Wfatal-errors -funroll-loops -Wno-deprecated-declarations -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function -Wno-format-truncation -Wno-attributes -Wno-stringop-truncation -I./include -I./cbffmpeg -I./cbsrt/srtcore -I./cbsrt -I./cblibcurl/include/curl ./source/dataqueue.c gcc -g -c -O2 -m64 -Wall -Wfatal-errors -funroll-loops -Wno-deprecated-declarations -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function -Wno-format-truncation -Wno-attributes -Wno-stringop-truncation -I./include -I./cbffmpeg -I./cbsrt/srtcore -I./cbsrt -I./cblibcurl/include/curl ./source/esignal.c gcc -g -c -O2 -m64 -Wall -Wfatal-errors -funroll-loops -Wno-deprecated-declarations -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function -Wno-format-truncation -Wno-attributes -Wno-stringop-truncation -I./include -I./cbffmpeg -I./cbsrt/srtcore -I./cbsrt -I./cblibcurl/include/curl ./source/udpsource.c gcc -g -c -O2 -m64 -Wall -Wfatal-errors -funroll-loops -Wno-deprecated-declarations -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function -Wno-format-truncation -Wno-attributes -Wno-stringop-truncation -I./include -I./cbffmpeg -I./cbsrt/srtcore -I./cbsrt -I./cblibcurl/include/curl ./source/cJSON.c gcc -g -c -O2 -m64 -Wall -Wfatal-errors -funroll-loops -Wno-deprecated-declarations -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function -Wno-format-truncation -Wno-attributes -Wno-stringop-truncation -I./include -I./cbffmpeg -I./cbsrt/srtcore -I./cbsrt -I./cblibcurl/include/curl ./source/cJSON_Utils.c ar rcs libsrthub.a crc.o tsdecode.o mempool.o dataqueue.o esignal.o udpsource.o cJSON.o cJSON_Utils.o finishing building lib gcc -g -c -O2 -m64 -Wall -Wfatal-errors -funroll-loops -Wno-deprecated-declarations -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-function -Wno-format-truncation -Wno-attributes -Wno-stringop-truncation -I./include -I./cbffmpeg -I./cbsrt/srtcore -I./cbsrt -I./cblibcurl/include/curl ./source/srthub.c ./source/srthub.c: In function ‘receive_frame’: ./source/srthub.c:212:20: warning: implicit declaration of function ‘gettid’; did you mean ‘getgid’? [-Wimplicit-function-declaration] 212 | int threadid = gettid(); | ^~ | getgid g++ srthub.o crc.o tsdecode.o mempool.o dataqueue.o esignal.o udpsource.o cJSON.o cJSON_Utils.o -L./ ./cbffmpeg/libavfilter/libavfilter.a ./cbffmpeg/libavformat/libavformat.a ./cbffmpeg/libswscale/libswscale.a ./cbffmpeg/libavcodec/libavcodec.a ./cbffmpeg/libavutil/libavutil.a ./cbffmpeg/libswresample/libswresample.a ./cbsrt/libsrt.a ./cblibcurl/lib/.libs/libcurl.a /usr/lib/x86_64-linux-gnu/libcrypto.a -lz -ldl -lssl -lm -lpthread -o srthub /usr/bin/ld: ./cbffmpeg/libavcodec/libavcodec.a(tiff.o): in function tiff_uncompress_lzma': /home/martin/opensrthub/cbffmpeg/libavcodec/tiff.c:398: undefined reference tolzma_stream_decoder' /usr/bin/ld: /home/xxx/opensrthub/cbffmpeg/libavcodec/tiff.c:403: undefined reference to lzma_code' /usr/bin/ld: /home/xxx/opensrthub/cbffmpeg/libavcodec/tiff.c:404: undefined reference tolzma_end' /usr/bin/ld: ./cblibcurl/lib/.libs/libcurl.a(libcurl_la-version.o): in function curl_version': version.c:(.text+0x99): undefined reference toBrotliDecoderVersion' /usr/bin/ld: ./cblibcurl/lib/.libs/libcurl.a(libcurl_la-version.o): in function curl_version_info': version.c:(.text+0x11d): undefined reference toBrotliDecoderVersion' /usr/bin/ld: version.c:(.text+0x128): undefined reference to BrotliDecoderVersion' /usr/bin/ld: ./cblibcurl/lib/.libs/libcurl.a(libcurl_la-content_encoding.o): in functionbrotli_close_writer': content_encoding.c:(.text+0x82): undefined reference to BrotliDecoderDestroyInstance' /usr/bin/ld: ./cblibcurl/lib/.libs/libcurl.a(libcurl_la-content_encoding.o): in functionbrotli_init_writer': content_encoding.c:(.text+0xb6): undefined reference to BrotliDecoderCreateInstance' /usr/bin/ld: ./cblibcurl/lib/.libs/libcurl.a(libcurl_la-content_encoding.o): in functionbrotli_unencode_write': content_encoding.c:(.text+0x2c2): undefined reference to BrotliDecoderDecompressStream' /usr/bin/ld: content_encoding.c:(.text+0x2f5): undefined reference toBrotliDecoderDestroyInstance' /usr/bin/ld: content_encoding.c:(.text+0x345): undefined reference to `BrotliDecoderGetErrorCode' collect2: error: ld returned 1 exit status make: *** [Makefile:30: srthub] Error 1 srthub: srthub did not get built - please check manually, aborting installation!

cannonbeach commented 6 months ago

Hmmm.. I wondering if libcurl detects that you have some packages already installed on your system. Is it a clean system?

Try the following diff and if that works, I'll push it up: diff --git a/Makefile b/Makefile index ff94cfe..5b5fc7b 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ INC += -I./cbsrt/srtcore INC += -I./cbsrt INC += -I./cblibcurl/include/curl

-BASELIBS += -lz -ldl -lssl +BASELIBS += -lz -ldl -lssl -llzma

all: $(LIB) srthub

tapeworm@tapeworm:~/opensrthub$ git diff setupopensrthub.sh diff --git a/setupopensrthub.sh b/setupopensrthub.sh index a47ff04..0907900 100755 --- a/setupopensrthub.sh +++ b/setupopensrthub.sh @@ -100,6 +100,8 @@ echo "srthub: installing nasm" sudo apt-get install nasm -y echo "srthub: installing libz" sudo apt-get install libz-dev -y +echo "srthub: installing liblzma-dev" +sudo apt-get install liblzma-dev -y echo "srthub: installing pkg-config" sudo apt-get install pkg-config -y echo "srthub: installing ca-certificates" @@ -179,7 +181,7 @@ else exit fi echo "Configuring curl for compilation" -./configure --prefix=/usr --enable-static --enable-pthreads --without-ssl --without-librtmp --without-libidn2 --without-nghttp2 +./configure --prefix=/usr --enable-static --enable-pthreads --without-ssl --without-librtmp --without-libidn2 --without-nghttp2 --without-brotli make -j8 if [ -f "./lib/.libs/libcurl.a" ]; then echo "srthub: libcurl.a was compiled correctly"

ma-blip commented 6 months ago

Not a new system. The fix did the trick. Thanks.

cannonbeach commented 6 months ago

Great! Really sorry about that. I have run into issues before with libcurl enabling options automatically and then causing issues linking. If you have any other problems, let me know and I'll do my best to help resolve.