justdan96 / tsMuxer

tsMuxer is a transport stream muxer for remuxing/muxing elementary streams, EVO/VOB/MPG, MKV/MKA, MP4/MOV, TS, M2TS to TS to M2TS. Supported video codecs H.264/AVC, H.265/HEVC, VC-1, MPEG2. Supported audio codecs AAC, AC3 / E-AC3(DD+), DTS/ DTS-HD.
Apache License 2.0
868 stars 147 forks source link

/osdep/textSubtitlesRenderFT.cpp: "#include <filesystem>" no such file or directory,... #471

Closed Selur closed 2 years ago

Selur commented 3 years ago

I'm on Ubuntu 18.04 trying to build tsMuxeR

+ mkdir build
+ cd build
+ git clone https://github.com/justdan96/tsMuxer
Cloning into 'tsMuxer'...
remote: Enumerating objects: 2848, done.
remote: Counting objects: 100% (222/222), done.
remote: Compressing objects: 100% (177/177), done.
remote: Total 2848 (delta 116), reused 80 (delta 39), pack-reused 2626
Receiving objects: 100% (2848/2848), 2.45 MiB | 2.53 MiB/s, done.
Resolving deltas: 100% (1895/1895), done.
+ cd tsMuxer
+ ./rebuild_linux.sh
-- The CXX compiler identification is GNU 7.5.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The C compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'zlib'
--   Found zlib, version 1.2.11
-- Checking for module 'freetype2'
--   Found freetype2, version 21.0.15
-- Configuring done
-- Generating done
-- Build files have been written to: /home/selur/workspace/HybridDeploy/tools/build/tsMuxer/build
[52/60] Building CXX object tsMuxer/CMakeFiles/tsmuxer.dir/osdep/textSubtitlesRenderFT.cpp.o
FAILED: tsMuxer/CMakeFiles/tsmuxer.dir/osdep/textSubtitlesRenderFT.cpp.o 
/usr/bin/c++  -DTSMUXER_VERSION=\"git-149fd8b\" -I../tsMuxer/../libmediation -I/usr/include/freetype2 -I/usr/include/libpng16 -std=c++1z -MD -MT tsMuxer/CMakeFiles/tsmuxer.dir/osdep/textSubtitlesRenderFT.cpp.o -MF tsMuxer/CMakeFiles/tsmuxer.dir/osdep/textSubtitlesRenderFT.cpp.o.d -o tsMuxer/CMakeFiles/tsmuxer.dir/osdep/textSubtitlesRenderFT.cpp.o -c ../tsMuxer/osdep/textSubtitlesRenderFT.cpp
../tsMuxer/osdep/textSubtitlesRenderFT.cpp:30:10: fatal error: filesystem: No such file or directory
 #include <filesystem>
          ^~~~~~~~~~~~
compilation terminated.

(happens while using https://github.com/Selur/hybrid-vapoursynth-addon -> build-tools.sh)

Am I missing some dependency?

Cu Selur

jcdr428 commented 3 years ago

@Selur I am no compiler specialist, however if c++11 is the standard in GNU 7.5.0, you might have to force the use of c++17.

justdan96 commented 3 years ago

From this SO: https://askubuntu.com/questions/1256440/how-to-get-libstdc-with-c17-filesystem-headers-on-ubuntu-18-bionic

It looks like there is a solution for Ubuntu 18:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-9 g++-9
Selur commented 3 years ago

Nice, will try to test on the weekend.

qyot27 commented 3 years ago

Short of calling in https://github.com/gulrak/filesystem as a git submodule. That's what we do for AviSynth+ on OSes that use GCC 7* (GCC 8 merely requires linking in libstdc++fs; GCC 9 mainlined it into the normal libstdc++).

older Ubuntu LTSes, as above, or Tigerbrew on PPC Macs. I think one of the BSDs also still ships with GCC 7 as its default compiler as well, or that it may use a newer GCC but disabled the filesystem support? I can't remember exactly.

Selur commented 3 years ago

Okay, installing gcc-9 and g++9 did not really help,... Now I got: gcc gcc-9 gcc-ar-7 gcc-nm gcc-nm-9 gcc-ranlib-7
gcc-7 gcc-ar gcc-ar-9 gcc-nm-7 gcc-ranlib gcc-ranlib-9 and g++ g++-7 g++-9 on my system, but calling './rebuild_linux.sh' still fails with the same error sind the default gcc is gcc-7 and not 9. Adding export CXX=gcc-9 helped with that. Now it fails with:

[60/60] Linking CXX executable tsMuxer/tsmuxer
FAILED: tsMuxer/tsmuxer 
: && /usr/bin/gcc-9    -rdynamic tsMuxer/CMakeFiles/tsmuxer.dir/aac.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/aacStreamReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/AbstractDemuxer.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/abstractMuxer.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/ac3Codec.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/ac3StreamReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/avCodecs.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/bitStream.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/blurayHelper.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/bufferedFileReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/bufferedFileWriter.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/bufferedReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/bufferedReaderManager.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/combinedH264Demuxer.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/convertUTF.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/dtsStreamReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/dvbSubStreamReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/h264StreamReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/hevc.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/hevcStreamReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/ioContextDemuxer.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/iso_writer.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/lpcmStreamReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/main.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/matroskaDemuxer.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/matroskaParser.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/metaDemuxer.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/movDemuxer.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/mp3Codec.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/mpeg2StreamReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/mpegAudioStreamReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/mpegStreamReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/mpegVideo.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/muxerManager.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/nalUnits.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/pesPacket.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/programStreamDemuxer.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/psgStreamReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/simplePacketizerReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/singleFileMuxer.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/srtStreamReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/textSubtitles.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/textSubtitlesRender.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/tsDemuxer.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/tsMuxer.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/tsPacket.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/utf8Converter.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/vc1Parser.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/vc1StreamReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/vod_common.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/vvc.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/vvcStreamReader.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/wave.cpp.o tsMuxer/CMakeFiles/tsmuxer.dir/osdep/textSubtitlesRenderFT.cpp.o  -o tsMuxer/tsmuxer  libmediation/libmediation.a -lz -lfreetype -lfreetype -lpthread && :
/usr/bin/ld: tsMuxer/CMakeFiles/tsmuxer.dir/psgStreamReader.cpp.o: undefined reference to symbol 'floor@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
justdan96 commented 3 years ago

It appears -lm needs to be added to the link line. For now can you test by running CMake, looking for the link.txt file, adding -lm to the end and then running Make?

Selur commented 3 years ago

I called export CXX=gcc-9 ran cmake modifying ./tsMuxer/CMakeFiles/tsmuxer.dir/link.txt then calling make and got tons of missing references: buildfail.txt

justdan96 commented 3 years ago

There are so many missing dependencies it makes me think there is an issue with the toolchain. I might have to try this out in a Ubuntu 18.04 Docker container.

Selur commented 3 years ago

might be. as a side note: works fine on Ubuntu 20.04 and I will also look at it in a new 18.04 VM over the weekend (busy week)

justdan96 commented 3 years ago

Clang-10 should be available in Ubuntu 18 and should work, I might get some time at the weekend to have a look, otherwise it will be next week.

jcdr428 commented 2 years ago

Hi @Selur , have you sorted out the issue ?

Selur commented 2 years ago

Nope, still stuck where I stopped on 27th of October.

justdan96 commented 2 years ago

I am going to (hopefully) be pushing a large update to the Docker container we use to generate the nightly builds. In this update we will be using Ubuntu 18.04 with cmake 3.14.5 and Apple Clang 12 so if all our builds work in that container we should be able to also use the same steps on your Ubuntu 18.04 machine.

Edit: I just noticed in that repository they are using GCC 11, can you confirm if you are still seeing the issue? https://github.com/Selur/hybrid-vapoursynth-addon/commit/2bed72ea53e5199bd480d6a1dd6a0ca16460b743

justdan96 commented 2 years ago

Edit: Fixed by #588