Open martap79 opened 5 years ago
Also failing on High Sierra (10.13.6).
I think the problem lies in Tesseract 4's use of the c++ 11 standard, which is not the default c++ standard used by the XCode command line tools. It looks like the cmake configuration files for vobsub2srt have not been updated for Tesseract 4. You can specify that cmake use the c++ 11 standard when building vobsub2srt by changing two files.
CMakeModules/FindTesseract.cmake:
--- FindTesseract.cmake 2018-12-28 21:47:27.000000000 -0500
+++ FindTesseract-20181228.cmake 2018-12-28 21:33:47.000000000 -0500
@@ -44,6 +44,7 @@
endif()
set(CMAKE_REQUIRED_INCLUDES ${Tesseract_INCLUDE_DIR})
+set(CMAKE_REQUIRED_FLAGS "-std=c++11")
check_cxx_source_compiles(
"#include \"tesseract/baseapi.h\"
using namespace tesseract;
and CMakeLists.txt:
--- CMakeLists.txt 2018-12-28 21:17:17.000000000 -0500
+++ CMakeLists-20181228.txt 2018-12-28 21:20:16.000000000 -0500
@@ -3,6 +3,7 @@
cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
+set(CMAKE_CXX_STANDARD 11)
if(NOT CMAKE_BUILD_TYPE)
set(
After applying the two patches above, then running ./configure
and make install
, I got vobsub2srt to build, install, and work.
I think the problem lies in Tesseract 4's use of the c++ 11 standard, which is not the default c++ standard used by the XCode command line tools. It looks like the cmake configuration files for vobsub2srt have not been updated for Tesseract 4. You can specify that cmake use the c++ 11 standard when building vobsub2srt by changing two files.
CMakeModules/FindTesseract.cmake:
--- FindTesseract.cmake 2018-12-28 21:47:27.000000000 -0500 +++ FindTesseract-20181228.cmake 2018-12-28 21:33:47.000000000 -0500 @@ -44,6 +44,7 @@ endif() set(CMAKE_REQUIRED_INCLUDES ${Tesseract_INCLUDE_DIR}) +set(CMAKE_REQUIRED_FLAGS "-std=c++11") check_cxx_source_compiles( "#include \"tesseract/baseapi.h\" using namespace tesseract;
and CMakeLists.txt:
--- CMakeLists.txt 2018-12-28 21:17:17.000000000 -0500 +++ CMakeLists-20181228.txt 2018-12-28 21:20:16.000000000 -0500 @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules) +set(CMAKE_CXX_STANDARD 11) if(NOT CMAKE_BUILD_TYPE) set(
After applying the two patches above, then running
./configure
andmake install
, I got vobsub2srt to build, install, and work.
how can I find those files "CMakeModules/FindTesseract.cmake" and "CMakeLists.txt" ? do I need to edit it manually?
I think the problem lies in Tesseract 4's use of the c++ 11 standard, which is not the default c++ standard used by the XCode command line tools. It looks like the cmake configuration files for vobsub2srt have not been updated for Tesseract 4. You can specify that cmake use the c++ 11 standard when building vobsub2srt by changing two files. CMakeModules/FindTesseract.cmake:
--- FindTesseract.cmake 2018-12-28 21:47:27.000000000 -0500 +++ FindTesseract-20181228.cmake 2018-12-28 21:33:47.000000000 -0500 @@ -44,6 +44,7 @@ endif() set(CMAKE_REQUIRED_INCLUDES ${Tesseract_INCLUDE_DIR}) +set(CMAKE_REQUIRED_FLAGS "-std=c++11") check_cxx_source_compiles( "#include \"tesseract/baseapi.h\" using namespace tesseract;
and CMakeLists.txt:
--- CMakeLists.txt 2018-12-28 21:17:17.000000000 -0500 +++ CMakeLists-20181228.txt 2018-12-28 21:20:16.000000000 -0500 @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules) +set(CMAKE_CXX_STANDARD 11) if(NOT CMAKE_BUILD_TYPE) set(
After applying the two patches above, then running
./configure
andmake install
, I got vobsub2srt to build, install, and work.how can I find those files "CMakeModules/FindTesseract.cmake" and "CMakeLists.txt" ? do I need to edit it manually?
yes
cd /Users/username/Library/Caches/Homebrew/vobsub2srt--git/
nano CMakeModules/FindTesseract.cmake
nano CMakeLists.txt
./configure
make install
Sorry, I don't exactly understood, I have found the two file and the content si long, what you write as modification is to be add in the end, or replace all content?
See the "+" sign next to the code, just add that code without the plus sign. In the first file it is about line 46, and the second about line five. I did it and the solution works.
I patched it for you @paolo-hub so just type:
brew install --HEAD https://github.com/brianchandotcom/VobSub2SRT/raw/master/packaging/vobsub2srt.rb
Works for me on Mojave.
Many thanks!
Thank you, thank you, thank you! I was tearing my hair out on this one.
Fails on High Sierra:
$ brew install --HEAD https://github.com/ruediger/VobSub2SRT/raw/master/packaging/vobsub2srt.rb Traceback (most recent call last):
brew extract
orbrew create
andbrew tap-new
to create a formula file in a tap on GitHub instead.: Invalid usage: Non-checksummed download of vobsub2srt formula file from an arbitrary URL is unsupported! (UsageError)brew extract
orbrew create
andbrew tap-new
to create a formula file in a tap on GitHub instead.: Invalid usage: Non-checksummed download of vobsub2srt formula file from an arbitrary URL is unsupported! (UsageError)
Installing vobsub2srt --HEAD ==> Cloning git://github.com/ruediger/VobSub2SRT.git Cloning into '/Users/marvin/Library/Caches/Homebrew/vobsub2srt--git'... ==> Checking out branch master Already on 'master' Your branch is up to date with 'origin/master'. ==> cmake .. -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/vobsub ==> make install Last 15 lines from /Users/marvin/Library/Logs/Homebrew/vobsub2srt/02.make: ^ In file included from /tmp/vobsub2srt-20181107-81806-lxgjcj/src/vobsub2srt.c++:27: In file included from /usr/local/include/tesseract/baseapi.h:32: /usr/local/include/tesseract/serialis.h:60:43: error: unknown type name 'size_t'; did you mean 'ssize_t'? bool DeSerialize(FILE fp, int32_t data, size_t n = 1); ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/sys/_types/_ssize_t.h:31:33: note: 'ssize_t' declared here typedef __darwin_ssize_t ssize_t; ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. make[2]: [src/CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o] Error 1 make[2]: Waiting for unfinished jobs.... make[1]: [src/CMakeFiles/vobsub2srt.dir/all] Error 2 make: [all] Error 2