0.47 compile problem

  • Anna

    Anna - 2009-04-08

    I had a problem with compiling 0.47 which I was able to fix, but I wanted to tell others in case someone else had the problem.  I am not a coder, so I don't know if there is a better fix.

    I have an older SUSE 10.1 system which had netpbm installed. At this point, the netpbm was too old and I installed a newer version in a different directory.  I could not remove the old version because the dependencies would break other OS installed applications.

    Even though I used this command for the configuration.

    ./configure --with-netpbm=/usr/local/netpbm

    The compile would still reference the /usr/bin files when it actually tried to compile "gocr", and then it would fail.

    # make it conform to ld --as-needed
    #gcc -o gocr -lm  gocr.o ./libPgm2asc.a -lnetpbm
    gcc -o gocr gocr.o pgm2asc.o box.o database.o detect.o barcode.o lines.o list.o ocr0.o ocr0n.o ocr1.o otsu.o output.o pixel.o unicode.o remove.o pnm.o pcx.o progress.o job.o -lnetpbm
    /usr/lib/libnetpbm.so: undefined reference to `log'
    /usr/lib/libnetpbm.so: undefined reference to `pow'
    collect2: ld returned 1 exit status
    make[1]: *** [gocr] Error 1

    I finally figured out the library flag for the compile wasn't being included when it compiled "gocr".  By changing the "src/Makefile.in" as shown below the compile worked correctly.

    --- Makefile.in 2009-04-07 16:59:28.000000000 -0700
    +++ Makefile.in-dist    2009-03-29 13:30:07.000000000 -0700
    @@ -78,7 +78,7 @@
    $(PROGRAM): $(LIBOBJS) gocr.o
            # make it conform to ld --as-needed
            #$(CC) -o $@ $(LDFLAGS) gocr.o ./lib$(PGMASCLIB).a $(LIBS)
    -       $(CC) -o $@ $(LDFLAGS) gocr.o $(LIBOBJS) $(LIBS)
    +       $(CC) -o $@ gocr.o $(LIBOBJS) $(LIBS)
            if test -r $(PROGRAM); then cp $@ ../bin; fi

    • Joerg Schulenburg

      thanks. LDFLAGS will be inserted in the next version.


Log in to post a comment.