# gutenprint make problem

## stephandale

I've been trying to install gutenprint on an old machine, but I've had no luck so far. Has anyone else had a similar problems?...

After ./configure I ran make. It went fine for a while but then just hung and did nothing for days when it hit the print.c file. It looks like it just ran out of memory. Has anyone else had this problem?

```

---cut---

make[3]: Entering directory `/home/steph/programs/gutenprint-5.1.0/src/gutenprintui2'

/bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../..  -I../../include -I../../include  -Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wwrite-strings -Werror-implicit-function-declaration -Winline -Wformat=2 -finline-limit=1048576   -Disfinite=finite  -O6  -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -Disfinite=finite  -O6 -c -o libgutenprintui2_la-panel.lo `test -f 'panel.c' || echo './'`panel.c

 gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include -I../../include -Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wwrite-strings -Werror-implicit-function-declaration -Winline -Wformat=2 -finline-limit=1048576 -Disfinite=finite -O6 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Disfinite=finite -O6 -c panel.c  -fPIC -DPIC -o .libs/libgutenprintui2_la-panel.o

In file included from /usr/include/gtk-2.0/gtk/gtkactiongroup.h:34,

                 from /usr/include/gtk-2.0/gtk/gtk.h:38,

                 from ../../include/gutenprintui2/gutenprintui.h:41,

                 from panel.c:36:

/usr/include/gtk-2.0/gtk/gtkitemfactory.h:50: warning: function declaration isn't a prototype

panel.c: In function `set_entry_value':

panel.c:2410: warning: format not a string literal, argument types not checked
```

I suppose it could be just because it's an old machine, but I've not had any compilation problems like this before (even with intensive programs like X11).

----------

## wynn

gutenprint 5.1.0 doesn't seem to compile â but you have a different error

```
i686-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I../..  -I../../include -I../../include -Wall -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wwrite-strings -Werror-implicit-function-declaration -Winline -Wformat=2 -finline-limit=1048576 -Disfinite=finite -O2 -march=pentium4 -pipe -fno-inline-functions -fno-inline-functions -fno-inline-functions -O6 -c rastertoprinter.c

genppd.c: In function 'cat_ppd':

genppd.c:279: error: implicit declaration of function 'getlangs'

genppd.c:279: warning: nested extern declaration of 'getlangs'

genppd.c:279: warning: initialization makes pointer from integer without a cast

genppd.c:279: warning: unused variable 'all_langs'

make[3]: *** [gutenprint_5_1-genppd.o] Error 1

make[3]: *** Waiting for unfinished jobs....

make[3]: Leaving directory `/var/tmp/portage/media-gfx/gimp-print-5.1.0/work/gutenprint-5.1.0/src/cups'
```

no funny CFLAGS here either

```
# emerge --info

Portage 2.1.2.2 (default-linux/x86/2006.1, gcc-4.1.1, glibc-2.5-r0, 2.6.20-gentoo-r5 i686)

=================================================================

System uname: 2.6.20-gentoo-r5 i686 Intel(R) Pentium(R) 4 CPU 3.40GHz

Gentoo Base System release 1.12.9

...

ACCEPT_KEYWORDS="x86"

AUTOCLEAN="yes"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=pentium4 -pipe"

CHOST="i686-pc-linux-gnu"
```

----------

## stephandale

I'm trying 5.0 now. I'll keep you posted...

----------

## stephandale

I have the same problem with 5.0. My machine has been attempting to make it for 2 days now! Either there's a memory leak or my machine's too old to compile it. It's a Celeron 266MHz with 125M RAM, which I would have thought would be capable enough.

----------

## Zeezo

I managed to compile gutenprint successfully after facing the same problems in this forum. I am sharing how I managed to compile successfully, hopefully you will find the info useful in your cases as well.

gutenprint 5.1.0 was compiled successfully on Solaris 8 SPARC using GCC 3.4.6

I had to make two main changes for this to work:

1- Modifying the cofigure script by replacing "-Werror-implicit-function-declaration " with "-Wimplicit-function-declatation" (i.e: remove the word "error")

This prevents the compiler from exiting with a "error: implicit declaration of function `getlangs'" when compiling 

genppd.c. However, it fails quickly afterwards in the linking stage as shown below.

------------------------------------------------------------------------------------

gcc -Disfinite=finite -O6 -o gutenprint.5.1 gutenprint_5_1-genppd.o  -L/opt/csw/

lib -lcupsimage -lcups /opt/csw/lib/libtiff.so /opt/csw/lib/libjpeg.so /opt/csw/

lib/libpng12.so /opt/csw/lib/libgnutls.so /opt/csw/lib/libgcrypt.so /opt/csw/lib

/libgpg-error.so /opt/csw/lib/libintl.so /opt/csw/lib/libiconv.so -lc -lz -lpthr

ead -lresolv -lnsl -lsocket ../../src/main/.libs/libgutenprint.a -lm -R/opt/csw/

lib -R/opt/csw/lib

Undefined                       first referenced

 symbol                             in file

getlangs                            gutenprint_5_1-genppd.o

ld: fatal: Symbol referencing errors. No output written to gutenprint.5.1

collect2: ld returned 1 exit status

make[3]: *** [gutenprint.5.1] Error 1

make[3]: Leaving directory `/var/slb/gutenprint-5.1.0/src/cups'

make[2]: *** [all-recursive] Error 1

make[2]: Leaving directory `/var/slb/gutenprint-5.1.0/src'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/var/slb/gutenprint-5.1.0'

make: *** [all] Error 2

----------------------------------------------------------------------------------------------

2- The above error was solved by setting the LDFLAGS environment variable to "-z nodefs" before running the configure script.

This will set the LDFLAGS variable in the Makefile to "-z nodefs" and prevent the linker from exiting with an undefined referenced symbol for getlangs.

So to summarize, edit the configure file and set the LDFLAGS environment variable as explained above, then run ./configure; make; make install. (I used ./configure --without-gimp)

These two changes made the make and make install finish successfully for me.

I was able to find the guten-print 5.1 drivers in cups administration window when adding a printer so it looks good, but I still need to test printing successfully. 

Some other notes you might find useful:

- I got exactly the same errors with both the guten-print 5.1.0 & 5.0.0.99.1 packages before it was solved using the two changes above.

- guten-print 5.1.0 failed with an out of memory in the middle of the compilation using GCC 3.3.2. (It did not reach the stage of compiling genppd.c)

- I was using SMCmake version 3.81

Happy Compiling   :Wink: 

----------

## wynn

It must depend on the gcc version, after failing the first time it entered portage (about March 15) it compiled without problems on 26 April. In both cases gcc-4.1.1-r3 on x86. It then compiled on x86_64 as well.

----------

## stephandale

Oddly, though gutenprint-5.0 failed when attempting to configure and make it myself, gimp-print-5.0.0 in portage compiled ok.

----------

## wynn

 *stephandale wrote:*   

> Oddly, though gutenprint-5.0 failed when attempting to configure and make it myself, gimp-print-5.0.0 in portage compiled ok.

 All praise to the Gentoo devs   :Smile: 

----------

