You cannot just point the include path at the build tree; the layout
of the build tree include files is different from the layout of the
include directories when installed.

So,  you need to install iulib somewhere, even if it is in /tmp, and
then point at that include directory.

If you know of a better way of doing this, maybe you can suggest it,
but we haven't found one.  Making what you suggest work is nice for
some environments, but it makes the installed version of iulib messier
to use.

Tom

On Jul 17, 3:40 am, David Terei <[email protected]> wrote:
> Hi All,
>
> I've been trying to compile Ocropus 0.4 for a while now with no
> success. There are two problems I encounter.
>
> Issue 1:
>
> ./build --with-tesseract=/home/davidt/software/tessercat-2.04 --with-
> iulib=/home/davidt/software/iulib/ --prefix=/home/davidt/software/
> ocropus-0.4/
>
> This fails with:
>
> checking for exit in -liulib... no
> configure: error: no iulib; please install iulib first (see INSTALL)
>
> looking at config.log I get:
>
> configure:5059: checking for exit in -liulib
> configure:5089: g++ -o conftest -g -O2 -I/home/davidt/software/
> libpng-1.2.37/include/ -I/home/davidt/software/openmotif-2.3.2/
> include/ -I/home/davidt/software/tiff-3.8.2/include/ -I/home/davidt/
> software/poppler-0.10.7/include -I/home/davidt/software/jpeg-7/include
> -I/home/davidt/software/iulib/include -I/home/davidt/software/iulib/
> include/iulib -I/home/davidt/software/iulib/colib -I/home/davidt/
> software/leptonlib-1.60/include/liblept -I/home/davidt/software/
> mpfr-2.4.1/include -I/home/davidt/software/gmp-4.3.1/include -I/home/
> davidt/software/gsl-1.12/include -I/home/davidt/software/
> tessercat-2.04/include -I/home/davidt/software/tcl-8.5.7/include -L/
> home/davidt/software/libpng-1.2.37/lib/ -L/home/davidt/software/
> openmotif-2.3.2/lib/ -L/home/davidt/software/tiff-3.8.2/lib/ -L/home/
> davidt/software/poppler-0.10.7/lib -L/home/davidt/software/jpeg-7/lib -
> L/home/davidt/software/iulib/lib -L/home/davidt/software/
> leptonlib-1.60/lib -L/home/davidt/software/mpfr-2.4.1/lib -L/home/
> davidt/software/gmp-4.3.1/lib -L/home/davidt/software/gsl-1.12/lib -L/
> home/davidt/software/tcl-8.5.7/lib -L/home/davidt/software/
> tessercat-2.04/lib -L/home/davidt/software/iulib/lib/ conftest.cc -
> liulib  -ltiff -ljpeg -lpng -lz  >&5
> conftest.cc:43: error: declaration of C function 'char exit()'
> conflicts with
> conftest.cc:11: error: previous declaration 'void exit(int)' here
> configure:5095: $? = 1
> configure: failed program was:
> | /* confdefs.h.  */
> |
> | #define PACKAGE_NAME "ocropus"
> | #define PACKAGE_TARNAME "ocropus"
> | #define PACKAGE_VERSION "0.3"
> | #define PACKAGE_STRING "ocropus 0.3"
> | #define PACKAGE_BUGREPORT ""
> | #define PACKAGE "ocropus"
> | #define VERSION "0.3"
> | #ifdef __cplusplus
> | extern "C" void exit (int) throw ();
> | #endif
> | #define STDC_HEADERS 1
> | #define HAVE_SYS_WAIT_H 1
> | #define HAVE_SYS_TYPES_H 1
> | #define HAVE_SYS_STAT_H 1
> | #define HAVE_STDLIB_H 1
> | #define HAVE_STRING_H 1
> | #define HAVE_MEMORY_H 1
> | #define HAVE_STRINGS_H 1
> | #define HAVE_INTTYPES_H 1
> | #define HAVE_STDINT_H 1
> | #define HAVE_UNISTD_H 1
> | #define HAVE_FLOAT_H 1
> | #define HAVE_MALLOC_H 1
> | #define HAVE_STDINT_H 1
> | #define HAVE_STDLIB_H 1
> | #define HAVE_STRING_H 1
> | #define HAVE_UNISTD_H 1
> | #define HAVE_WCHAR_H 1
> | #define HAVE_LIBZ 1
> | #define HAVE_LIBPNG 1
> | #define HAVE_LIBJPEG 1
> | #define HAVE_LIBTIFF 1
> | /* end confdefs.h.  */
> |
> | /* Override any gcc2 internal prototype to avoid an error.  */
> | #ifdef __cplusplus
> | extern "C"
> | #endif
> | /* We use char because int might match the return type of a gcc2
> |    builtin and then its argument prototype would still apply.  */
> | char exit ();
> | int
> | main ()
> | {
> | exit
> ();
> |   ;
> |   return 0;
> | }
> configure:5121: result: no
> configure:5131: error: no iulib; please install iulib first (see
> INSTALL)
>
> I'm not really sure what this error means, however I can hack around
> it by commenting out the 'char exit ();' line and changing the 'exit
> ();' line to be 'exit (0);'. This allows build to compete fine.
>
> Upon issuing 'make' everything goes well for a while and then I get:
>
> g++ -g -O2 -fopenmp -Wall -Wno-sign-compare -Wno-write-strings -Wno-
> deprecated -g -O2 -fopenmp  -L/home/davidt/software/libpng-1.2.37/lib/
> -L/home/davidt/software/openmotif-2.3.2/lib/ -L/home/davidt/software/
> tiff-3.8.2/lib/ -L/home/davidt/software/poppler-0.10.7/lib -L/home/
> davidt/software/jpeg-7/lib -L/home/davidt/software/iulib/lib -L/home/
> davidt/software/leptonlib-1.60/lib -L/home/davidt/software/mpfr-2.4.1/
> lib -L/home/davidt/software/gmp-4.3.1/lib -L/home/davidt/software/
> gsl-1.12/lib -L/home/davidt/software/tcl-8.5.7/lib -L/home/davidt/
> software/tessercat-2.04/lib -L/home/davidt/software/iulib/lib/ -L/home/
> davidt/software/leptonlib-1.60/include/liblept//../../lib -lgomp -Wl,-
> E -o ocropus  ocropus.o libocropus.a -lgomp -lgsl -lgslcblas -llept -
> ltesseract_full -lpthread -liulib -ltiff -ljpeg -lpng -lz
> libocropus.a(ocr-commands.o)(.text+0x8182): In function
> `ocropus::main_trainseg_or_saveseg(int, char**)':/home/davidt/software/
> iulib/include/iulib/dgraphics.h:41: undefined reference to
> `iulib::dsection_set(char const*)'
> libocropus.a(ocr-commands.o)(.text+0x81c1):/home/davidt/software/iulib/
> include/iulib/dgraphics.h:44: undefined reference to
> `iulib::dsection_set(char const*)'libocropus.a(ocr-commands.o)(.text
> +0x8455):/home/davidt/software/iulib/include/iulib/dgraphics.h:44:
> undefined reference to `iulib::dsection_set(char const*)'
> libocropus.a(ocr-commands.o)(.text+0xe367): In function
> `_ZN7ocropus15main_lines2fstsEiPPc.omp_fn.1':/home/davidt/software/
> iulib/include/iulib/dgraphics.h:41: undefined reference to
> `iulib::dsection_set(char const*)'
> libocropus.a(ocr-commands.o)(.text+0xe3e4):/home/davidt/software/iulib/
> include/iulib/dgraphics.h:44: undefined reference to
> `iulib::dsection_set(char const*)'
> libocropus.a(ocr-commands.o)(.text+0xf1cf):/home/davidt/software/iulib/
> include/iulib/dgraphics.h:44: more undefined references to
> `iulib::dsection_set(char const*)' followlibocropus.a(glclass.o)
> (.gnu.linkonce.t._ZN8glinerec13MlpClassifier5trainERNS_8IDatasetE
> +0x2f6): In function `glinerec::MlpClassifier::train
> (glinerec::IDataset&)':
> ./ocr-line/glclass.cc:1037: undefined reference to `iulib::dactive()'
> libocropus.a(glclass.o)
> (.gnu.linkonce.t._ZN8glinerec13MlpClassifier5trainERNS_8IDatasetE
> +0x581): In function `glinerec::MlpClassifier::train
> (glinerec::IDataset&)':/home/davidt/software/iulib/include/iulib/
> dgraphics.h:44: undefined reference to `iulib::dsection_set(char
> const*)'
> libocropus.a(glclass.o)
> (.gnu.linkonce.t._ZN8glinerec13MlpClassifier5trainERNS_8IDatasetE
> +0x718):/home/davidt/software/iulib/include/iulib/dgraphics.h:44:
> undefined reference to `iulib::dsection_set(char const*)'
> libocropus.a(linerec.o)
> (.gnu.linkonce.t._ZN8glinerec16LinerecExtracted18extractFeaturesAbsERN5colib6narrayIfEEi
> +0xa5): In function `glinerec::LinerecExtracted::extractFeaturesAbs
> (colib::narray<float>&, int)':
> /home/davidt/software/iulib/include/iulib/dgraphics.h:41: undefined
> reference to `iulib::dsection_set(char const*)'
> libocropus.a(linerec.o)
> (.gnu.linkonce.t._ZN8glinerec16LinerecExtracted18extractFeaturesAbsERN5colib6narrayIfEEi
> +0x390):/home/davidt/software/iulib/include/iulib/dgraphics.h:44:
> undefined reference to `iulib::dsection_set(char const*
> )'
> libocropus.a(linerec.o)
> (.gnu.linkonce.t._ZN8glinerec16LinerecExtracted18extractFeaturesAbsERN5colib6narrayIfEEi
> +0x46a):/home/davidt/software/iulib/include/iulib/dgraphics.h:44:
> undefined reference to `iulib::dsection_set(char const*
> )'
> libocropus.a(linerec.o)
> (.gnu.linkonce.t._ZN8glinerec16LinerecExtracted21extractFeaturesCenterERN5colib6narrayIfEEi
> +0x14):/home/davidt/software/iulib/include/iulib/dgraphics.h:41: more
> undefined references to `iulib::dsection_set(cha
> r const*)' follow
> libocropus.a(linerec.o)
> (.gnu.linkonce.t._ZN8glinerec16LinerecExtracted21extractFeaturesCenterERN5colib6narrayIfEEi
> +0x304): In function `glinerec::LinerecExtracted::extractFeaturesCenter
> (colib::narray<float>&, int)':
> ./ocr-line/linerec.cc:329: undefined reference to `iulib::dactive()'
> libocropus.a(linerec.o)
> (.gnu.linkonce.t._ZN8glinerec16LinerecExtracted21extractFeaturesCenterERN5colib6narrayIfEEi
> +0x918): In function `glinerec::LinerecExtracted::extractFeaturesCenter
> (colib::narray<float>&, int)':
> /home/davidt/software/iulib/include/iulib/dgraphics.h:44: undefined
> reference to `iulib::dsection_set(char const*)'
> libocropus.a(linerec.o)
> (.gnu.linkonce.t._ZN8glinerec16LinerecExtracted21extractFeaturesCenterERN5colib6narrayIfEEi
> +0xaf6):/home/davidt/software/iulib/include/iulib/dgraphics.h:44:
> undefined reference to `iulib::dsection_set(char const*)'
> libocropus.a(linerec.o)
> (.gnu.linkonce.t._ZN8glinerec16LinerecExtracted15addTrainingLineERN5colib6narrayIiEERNS2_IhEERNS1_8nustringE
> +0x9c): In function `glinerec::LinerecExtracted::addTrainingLine
> (colib::narray<int>&, colib::narray<unsigned char>&,
> colib::nustring&)':
> /home/davidt/software/iulib/include/iulib/dgraphics.h:41: undefined
> reference to `iulib::dsection_set(char const*)'
> libocropus.a(linerec.o)
> (.gnu.linkonce.t._ZN8glinerec16LinerecExtracted15addTrainingLineERN5colib6narrayIiEERNS2_IhEERNS1_8nustringE
> +0x113f):/home/davidt/software/iulib/include/iulib/dgraphics.h:44:
> undefined reference to `iulib::dsection_set(char const*)'
> libocropus.a(linerec.o)
> (.gnu.linkonce.t._ZN8glinerec16LinerecExtracted15addTrainingLineERN5colib6narrayIiEERNS2_IhEERNS1_8nustringE
> +0x11ff):/home/davidt/software/iulib/include/iulib/dgraphics.h:44:
> undefined reference to `iulib::dsection_set(char const*)'
> libocropus.a(linerec.o)
> (.gnu.linkonce.t._ZN8glinerec16LinerecExtracted13recognizeLineERN5colib6narrayIiEERN7ocropus11IGenericFstERNS2_IhEE
> +0xf3):/home/davidt/software/iulib/include/iulib/dgraphics.h:41: more
> undefined references to `iulib::dsection_set(char const*)' follow
> libocropus.a(glfmaps.o)
> (.gnu.linkonce.t._ZN8glinerec16SimpleFeatureMap15extractFeaturesERN5colib6narrayIfEENS1_9rectangleERNS2_IhEE
> +0x19d2): In function `glinerec::SimpleFeatureMap::extractFeatures
> (colib::narray<float>&, colib::rectangle, colib::narray<unsigned
> char>&)':
> ./ocr-line/glfmaps.cc:493: undefined reference to `iulib::dactive()'
> libocropus.a(glfmaps.o)
> (.gnu.linkonce.t._ZN8glinerec16SimpleFeatureMap15extractFeaturesERN5colib6narrayIfEENS1_9rectangleERNS2_IhEE
> +0x1b5d): In function `glinerec::SimpleFeatureMap::extractFeatures
> (colib::narray<float>&, colib::rectangle, colib::narray<unsigned
> char>&)':
> /home/davidt/software/iulib/include/iulib/dgraphics.h:44: undefined
> reference to `iulib::dsection_set(char const*)'
> libocropus.a(glfmaps.o)
> (.gnu.linkonce.t._ZN8glinerec16SimpleFeatureMap15extractFeaturesERN5colib6narrayIfEENS1_9rectangleERNS2_IhEE
> +0x1b8e):/home/davidt/software/iulib/include/iulib/dgraphics.h:44:
> undefined reference to `iulib::dsection_set(char const*)'
> libocropus.a(glfmaps.o)
> (.gnu.linkonce.t._ZN8glinerec16SimpleFeatureMap7setLineERN5colib6narrayIhEE
> +0x185): In function `glinerec::SimpleFeatureMap::setLine
> (colib::narray<unsigned char>&)':
> /home/davidt/software/iulib/include/iulib/dgraphics.h:41: undefined
> reference to `iulib::dsection_set(char const*)'
> libocropus.a(glfmaps.o)
> (.gnu.linkonce.t._ZN8glinerec16SimpleFeatureMap7setLineERN5colib6narrayIhEE
> +0x18b9):/home/davidt/software/iulib/include/iulib/dgraphics.h:44:
> undefined reference to `iulib::dsection_set(char const*)'
> libocropus.a(glfmaps.o)
> (.gnu.linkonce.t._ZN8glinerec16SimpleFeatureMap7setLineERN5colib6narrayIhEE
> +0x1aa2):/home/davidt/software/iulib/include/iulib/dgraphics.h:44:
> undefined reference to `iulib::dsection_set(char const*)'
> collect2: ld returned 1 exit status
> make[1]: *** [ocropus] Error 1
> make[1]: Leaving directory `/users/davidt/builds/ocropus-0.4/ocropus'
> make: *** [all-recursive] Error 1
>
> My understanding is that such an error indicates that the linker can't
> find iulib, but as you can see its clearly included on the command
> line with '-L'.
>
> Given both errors seem to relate to not being able to find iulib I
> imagine they're related but I don't really have any idea how to solve
> the issue when iulib compiled and checked fine and is clearly
> included.
>
> Thanks for the help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ocropus" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/ocropus?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to