ruediger / VobSub2SRT

Converts VobSub subtitles (.idx/.srt format) into .srt subtitles.
GNU General Public License v3.0
294 stars 67 forks source link

Compile error #14

Closed plopplopplop closed 12 years ago

plopplopplop commented 12 years ago

$ git clone https://github.com/ruediger/VobSub2SRT.git Cloning into 'VobSub2SRT'... remote: Counting objects: 356, done. remote: Compressing objects: 100% (203/203), done. remote: Total 356 (delta 214), reused 287 (delta 145) Receiving objects: 100% (356/356), 102.33 KiB, done. Resolving deltas: 100% (214/214), done.

$ ./configure -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- 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 -- Source: /tmp/VobSub2SRT -- Binary: /tmp/VobSub2SRT/build -- Build type: Debug -- checking for module 'libavutil' -- found libavutil, version 51.34.101 -- Looking for include files CMAKE_HAVE_PTHREAD_H -- Looking for include files CMAKE_HAVE_PTHREAD_H - 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 -- Performing Test TESSERACT_NAMESPACE -- Performing Test TESSERACT_NAMESPACE - Success -- Found Tesseract: /usr/lib/libtesseract_full.a;/usr/lib/i386-linux-gnu/libtiff.so -- vobsub2srt version: 23dcb63 -- Debian architecture: i386 -- Configuring done -- Generating done -- Build files have been written to: /tmp/VobSub2SRT/build

$ make make -C build make[1]: Entering directory /tmp/VobSub2SRT/build' make[2]: Entering directory/tmp/VobSub2SRT/build' make[3]: Entering directory /tmp/VobSub2SRT/build' Scanning dependencies of target mplayer make[3]: Leaving directory/tmp/VobSub2SRT/build' make[3]: Entering directory /tmp/VobSub2SRT/build' [ 14%] Building C object mplayer/CMakeFiles/mplayer.dir/mp_msg.c.o [ 28%] Building C object mplayer/CMakeFiles/mplayer.dir/spudec.c.o [ 42%] Building C object mplayer/CMakeFiles/mplayer.dir/unrar_exec.c.o [ 57%] Building C object mplayer/CMakeFiles/mplayer.dir/vobsub.c.o Linking C static library ../lib/libmplayer.a make[3]: Leaving directory/tmp/VobSub2SRT/build' [ 57%] Built target mplayer make[3]: Entering directory /tmp/VobSub2SRT/build' Scanning dependencies of target vobsub2srt make[3]: Leaving directory/tmp/VobSub2SRT/build' make[3]: Entering directory /tmp/VobSub2SRT/build' [ 71%] Building CXX object src/CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o [ 85%] Building CXX object src/CMakeFiles/vobsub2srt.dir/langcodes.c++.o [100%] Building CXX object src/CMakeFiles/vobsub2srt.dir/cmd_options.c++.o Linking CXX executable ../bin/vobsub2srt CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o: In functionmain': /tmp/VobSub2SRT/src/vobsub2srt.c++:155: undefined reference to tesseract::TessBaseAPI::TessBaseAPI()' /tmp/VobSub2SRT/src/vobsub2srt.c++:158: undefined reference totesseract::TessBaseAPI::SetVariable(char const, char const)' /tmp/VobSub2SRT/src/vobsub2srt.c++:207: undefined reference to tesseract::TessBaseAPI::TesseractRect(unsigned char const*, int, int, int, int, int, int)' /tmp/VobSub2SRT/src/vobsub2srt.c++:225: undefined reference totesseract::TessBaseAPI::End()' /tmp/VobSub2SRT/src/vobsub2srt.c++:232: undefined reference to tesseract::TessBaseAPI::~TessBaseAPI()' /tmp/VobSub2SRT/src/vobsub2srt.c++:232: undefined reference totesseract::TessBaseAPI::~TessBaseAPI()' CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o: In function tesseract::TessBaseAPI::Init(char const*, char const*)': /usr/include/tesseract/baseapi.h:208: undefined reference totesseract::TessBaseAPI::Init(char const, char const, tesseract::OcrEngineMode, char, int, GenericVector const, GenericVector const_, bool)' collect2: ld returned 1 exit status make[3]: _* [bin/vobsub2srt] Error 1 make[3]: Leaving directory /tmp/VobSub2SRT/build' make[2]: *** [src/CMakeFiles/vobsub2srt.dir/all] Error 2 make[2]: Leaving directory/tmp/VobSub2SRT/build' make[1]: * [all] Error 2 make[1]: Leaving directory `/tmp/VobSub2SRT/build' make: * [all] Error 2

$ dpkg -l | grep tesseract ii libtesseract-dev 3.02.01-2 Development files for the tesseract command line OCR tool ii libtesseract3 3.02.01-2 Command line OCR tool ii tesseract-ocr 3.02.01-2 Command line OCR tool ii tesseract-ocr-deu-f 2.01-2 tesseract-ocr language files for the German Fraktur script ii tesseract-ocr-dev 2.04-2+squeeze1 Development files for the tesseract command line OCR tool ii tesseract-ocr-eng 3.02-2 tesseract-ocr language files for English ii tesseract-ocr-equ 3.02-2 tesseract-ocr language files for equations ii tesseract-ocr-osd 3.02-2 tesseract-ocr language files for script and orientation

ruediger commented 12 years ago

looks like cmake has some problem selecting the right library. What Linux distribution are you using? Or where did you get the libresseract 3.* packages?

Please show the output of "make VERBOSE=1"

plopplopplop commented 12 years ago

I'm using debian testing (see the packages list at the bottom of the bug report). Fyi, there's been an update recently.

$ make VERBOSE=1 make -C build make[1]: Entering directory /tmp/VobSub2SRT/build' /usr/bin/cmake -H/tmp/VobSub2SRT -B/tmp/VobSub2SRT/build --check-build-system CMakeFiles/Makefile.cmake 0 /usr/bin/cmake -E cmake_progress_start /tmp/VobSub2SRT/build/CMakeFiles /tmp/VobSub2SRT/build/CMakeFiles/progress.marks make -f CMakeFiles/Makefile2 all make[2]: Entering directory/tmp/VobSub2SRT/build' make -f mplayer/CMakeFiles/mplayer.dir/build.make mplayer/CMakeFiles/mplayer.dir/depend make[3]: Entering directory /tmp/VobSub2SRT/build' cd /tmp/VobSub2SRT/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /tmp/VobSub2SRT /tmp/VobSub2SRT/mplayer /tmp/VobSub2SRT/build /tmp/VobSub2SRT/build/mplayer /tmp/VobSub2SRT/build/mplayer/CMakeFiles/mplayer.dir/DependInfo.cmake --color= make[3]: Leaving directory/tmp/VobSub2SRT/build' make -f mplayer/CMakeFiles/mplayer.dir/build.make mplayer/CMakeFiles/mplayer.dir/build make[3]: Entering directory /tmp/VobSub2SRT/build' make[3]: Nothing to be done formplayer/CMakeFiles/mplayer.dir/build'. make[3]: Leaving directory /tmp/VobSub2SRT/build' /usr/bin/cmake -E cmake_progress_report /tmp/VobSub2SRT/build/CMakeFiles 1 2 3 4 [ 57%] Built target mplayer make -f src/CMakeFiles/vobsub2srt.dir/build.make src/CMakeFiles/vobsub2srt.dir/depend make[3]: Entering directory/tmp/VobSub2SRT/build' cd /tmp/VobSub2SRT/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /tmp/VobSub2SRT /tmp/VobSub2SRT/src /tmp/VobSub2SRT/build /tmp/VobSub2SRT/build/src /tmp/VobSub2SRT/build/src/CMakeFiles/vobsub2srt.dir/DependInfo.cmake --color= make[3]: Leaving directory /tmp/VobSub2SRT/build' make -f src/CMakeFiles/vobsub2srt.dir/build.make src/CMakeFiles/vobsub2srt.dir/build make[3]: Entering directory/tmp/VobSub2SRT/build' Linking CXX executable ../bin/vobsub2srt cd /tmp/VobSub2SRT/build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/vobsub2srt.dir/link.txt --verbose=1 /usr/bin/c++ -ansi -pedantic-errors -Wall -Wextra -g3 -DDEBUG CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o CMakeFiles/vobsub2srt.dir/langcodes.c++.o CMakeFiles/vobsub2srt.dir/cmd_options.c++.o -o ../bin/vobsub2srt -rdynamic ../lib/libmplayer.a -lavutil -Wl,-Bstatic -ltesseractfull -Wl,-Bdynamic -ltiff -lpthread CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o: In function main': /tmp/VobSub2SRT/src/vobsub2srt.c++:155: undefined reference totesseract::TessBaseAPI::TessBaseAPI()' /tmp/VobSub2SRT/src/vobsub2srt.c++:158: undefined reference to tesseract::TessBaseAPI::SetVariable(char const*, char const*)' /tmp/VobSub2SRT/src/vobsub2srt.c++:207: undefined reference totesseract::TessBaseAPI::TesseractRect(unsigned char const, int, int, int, int, int, int)' /tmp/VobSub2SRT/src/vobsub2srt.c++:225: undefined reference to tesseract::TessBaseAPI::End()' /tmp/VobSub2SRT/src/vobsub2srt.c++:232: undefined reference totesseract::TessBaseAPI::~TessBaseAPI()' /tmp/VobSub2SRT/src/vobsub2srt.c++:232: undefined reference to tesseract::TessBaseAPI::~TessBaseAPI()' CMakeFiles/vobsub2srt.dir/vobsub2srt.c++.o: In functiontesseract::TessBaseAPI::Init(char const, char const)': /usr/include/tesseract/baseapi.h:208: undefined reference to tesseract::TessBaseAPI::Init(char const_, char const_, tesseract::OcrEngineMode, char__, int, GenericVector<STRING> const_, GenericVector<STRING> const_, bool)' collect2: ld returned 1 exit status make[3]: *_\* [bin/vobsub2srt] Error 1 make[3]: Leaving directory/tmp/VobSub2SRT/build' make[2]: * [src/CMakeFiles/vobsub2srt.dir/all] Error 2 make[2]: Leaving directory/tmp/VobSub2SRT/build' make[1]: **\* [all] Error 2 make[1]: Leaving directory/tmp/VobSub2SRT/build' make: * [all] Error 2

Thanks !

ruediger commented 12 years ago

I guess the problem is a mixup of the libraries. He finds the tesseract 3.* headers but tries to link to the tesseract 2.* libraries (libtesseract_full.a). You could run dpkg -S /usr/lib/libtesseract_full.a to figure out which package the library is from. The solution is probably to remove tesseract-ocr-dev and do a make distclean && ./configure. If that doesn't work then manually editing the build/CMakeCache.txt file or remove the 3.* version of tesseract.

I currently can't test it myself. But I'll take a look when I find the time to install a Debian testing vm or when Ubuntu has those packages. The problem is that Tesseract 2 and 3 have some major incompatibilities and sadly they don't come with a nice file (e.g., pkg-config) to tell you which version to use and what libraries to link. So CMake has to figure it out manually and the Module seems to get confused when there are both versions of tesseract installed.

We should push this issue: http://code.google.com/p/tesseract-ocr/issues/detail?id=451

plopplopplop commented 12 years ago

Removing tesseract-ocr-dev worked like a charm indeed. Thanks !