Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed on MacOS Mojave with Homebrew #73

Open
martap79 opened this issue Nov 7, 2018 · 10 comments
Open

Build failed on MacOS Mojave with Homebrew #73

martap79 opened this issue Nov 7, 2018 · 10 comments

Comments

@martap79
Copy link

martap79 commented Nov 7, 2018

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

@prov3it
Copy link

prov3it commented Nov 8, 2018

Also failing on High Sierra (10.13.6).

@quornicus
Copy link

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.

@esoftplay
Copy link

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.

how can I find those files "CMakeModules/FindTesseract.cmake" and "CMakeLists.txt" ?
do I need to edit it manually?

@creamcast
Copy link

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.

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

@paolo-hub
Copy link

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?

@gorillatronxx
Copy link

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.

brianchandotcom added a commit to brianchandotcom/VobSub2SRT that referenced this issue Dec 20, 2019
@brianchandotcom
Copy link

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.

brianchandotcom added a commit to brianchandotcom/VobSub2SRT that referenced this issue Dec 20, 2019
@paolo-hub
Copy link

Many thanks!

@rimmel
Copy link

rimmel commented Dec 27, 2019

Thank you, thank you, thank you! I was tearing my hair out on this one.

@mrobe
Copy link

mrobe commented Feb 6, 2021

Fails on High Sierra:

$ brew install --HEAD https://github.com/ruediger/VobSub2SRT/raw/master/packaging/vobsub2srt.rb
Traceback (most recent call last):
brew extract or brew create and brew 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 or brew create and brew 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants