blackfiveimaging / photoprint

Gutenprint-based photo printing application for Linux
GNU General Public License v2.0
9 stars 10 forks source link

PhotoPrint do not compile on modern (arch) linux #7

Open 6543 opened 3 years ago

6543 commented 3 years ago

linux: 5.10.8-artix x64 GNU automake: 1.16.2

make fail with:

In file included from /usr/include/c++/10.2.0/memory:83,
                 from ../support/refcountptr.h:14,
                 from imagesource.h:19,
                 from imagesource_pnm.h:16,
                 from imagesource_pnm.cpp:24:
/usr/include/c++/10.2.0/bits/unique_ptr.h:57:28: note: declared here
   57 |   template<typename> class auto_ptr;
      |                            ^~~~~~~~
In file included from imagesource_pnm.cpp:24:
imagesource_pnm.h:45:2: error: reference to 'tuple' is ambiguous
   45 |  tuple *tuplerow;
      |  ^~~~~
In file included from /usr/include/c++/10.2.0/bits/move.h:57,
                 from /usr/include/c++/10.2.0/bits/nested_exception.h:40,
                 from /usr/include/c++/10.2.0/exception:148,
                 from /usr/include/c++/10.2.0/ios:39,
                 from /usr/include/c++/10.2.0/ostream:38,
                 from /usr/include/c++/10.2.0/iostream:39,
                 from imagesource_pnm.cpp:13:
/usr/include/c++/10.2.0/type_traits:2631:11: note: candidates are: 'template<class ... _Elements> class std::tuple'
 2631 |     class tuple;
      |           ^~~~~
In file included from imagesource_pnm.h:28,
                 from imagesource_pnm.cpp:24:
/usr/include/netpbm/pam.h:195:17: note:                 'typedef sample* tuple'
  195 | typedef sample *tuple;
      |                 ^~~~~
imagesource_pnm.cpp: In destructor 'virtual ImageSource_PNM::~ImageSource_PNM()':
imagesource_pnm.cpp:30:5: error: 'tuplerow' was not declared in this scope; did you mean 'tuplen'?
   30 |  if(tuplerow)
      |     ^~~~~~~~
      |     tuplen
imagesource_pnm.cpp: In member function 'virtual ISDataType* ImageSource_PNM::GetRow(int)':
imagesource_pnm.cpp:49:26: error: 'tuplerow' was not declared in this scope; did you mean 'tuplen'?
   49 |   pnm_readpamrow(&header,tuplerow);
      |                          ^~~~~~~~
      |                          tuplen
imagesource_pnm.cpp:58:14: error: 'tuplerow' was not declared in this scope; did you mean 'tuplen'?
   58 |     sample s=tuplerow[x][0];
      |              ^~~~~~~~
      |              tuplen
In file included from imagesource.h:17,
                 from imagesource_pnm.h:16,
                 from imagesource_pnm.cpp:24:
imagesource_pnm.cpp:72:24: error: 'tuplerow' was not declared in this scope; did you mean 'tuplen'?
   72 |       *dst++=EIGHTTOIS(tuplerow[x][0]);
      |                        ^~~~~~~~
imagesource_types.h:8:25: note: in definition of macro 'EIGHTTOIS'
    8 | #define EIGHTTOIS(x) (((x) << 8) | (x))
      |                         ^
imagesource_pnm.cpp:78:14: error: 'tuplerow' was not declared in this scope; did you mean 'tuplen'?
   78 |       *dst++=tuplerow[x][0];
      |              ^~~~~~~~
      |              tuplen
imagesource_pnm.cpp: In constructor 'ImageSource_PNM::ImageSource_PNM(const char*)':
imagesource_pnm.cpp:89:16: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   89 |  char *argv[]={"PNMLoader",0};
      |                ^~~~~~~~~~~
imagesource_pnm.cpp:122:2: error: 'tuplerow' was not declared in this scope; did you mean 'tuplen'?
  122 |  tuplerow = pnm_allocpamrow(&header);
      |  ^~~~~~~~
      |  tuplen
make[2]: *** [Makefile:647: imagesource_pnm.lo] Error 1
make[2]: Leaving directory '/home/user/git/photoprint/library/imagesource'
make[1]: *** [Makefile:1005: all-recursive] Error 1
make[1]: Leaving directory '/home/user/git/photoprint'
make: *** [Makefile:730: all] Error 2
6543 commented 3 years ago

I think it has something to do with https://stackoverflow.com/questions/51251117/reference-to-tuple-is-ambiguous-in-seshat#comment89482201_51251117

robinsonb5 commented 3 years ago

Thanks for the report. It looks like the problem is that the old netpbm library defines "tuple" as a type, and it clashes with a new C++ class. Wrapping the netpbm includes in a namespace might help - could you try the attached patch, please?

pnmfix.patch.txt

6543 commented 3 years ago

@robinsonb5 thanks for the fast responce, yes it fix the specific issue but create new one (now you we have to apply pnm prefix to other files ...

6543 commented 3 years ago

@robinsonb5 created https://github.com/blackfiveimaging/library/pull/4 :)

now I get different compile error (unrelated to this ...)

6543 commented 3 years ago
/usr/include/gtk-2.0/gtk/gtktooltips.h:73:3: warning: 'GTimeVal' is deprecated: Use 'GDateTime' instead [-Wdeprecated-declarations]
   73 |   GTimeVal last_popdown;
      |   ^~~~~~~~
In file included from /usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/include/glib-2.0/glib.h:30,
                 from /usr/include/glib-2.0/gobject/gbinding.h:28,
                 from /usr/include/glib-2.0/glib-object.h:22,
                 from /usr/include/glib-2.0/gio/gioenums.h:28,
                 from /usr/include/glib-2.0/gio/giotypes.h:28,
                 from /usr/include/glib-2.0/gio/gio.h:26,
                 from /usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h:30,
                 from /usr/include/gtk-2.0/gdk/gdk.h:32,
                 from /usr/include/gtk-2.0/gtk/gtkwidget.h:34,
                 from /usr/include/gtk-2.0/gtk/gtkmisc.h:35,
                 from /usr/include/gtk-2.0/gtk/gtklabel.h:34,
                 from stpui_optionbook.c:17:
/usr/include/glib-2.0/glib/gtypes.h:547:8: note: declared here
  547 | struct _GTimeVal
      |        ^~~~~~~~~
  CCLD     libstpui_widgets.la
make[2]: Leaving directory '/home/user/git/photoprint/library/stpui_widgets'
Making all in library/stp_support
make[2]: Entering directory '/home/user/git/photoprint/library/stp_support'
  CC       printerqueues.lo
  CC       stputil.lo
In file included from printerqueues.c:12:
printerqueues_unix.c: In function 'getdriver':
printerqueues_unix.c:362:22: warning: implicit declaration of function 'cupsGetPPD'; did you mean 'cupsGetFd'? [-Wimplicit-function-declaration]
  362 |  const char *ppdname=cupsGetPPD(pq->priv->currentqueue);
      |                      ^~~~~~~~~~
      |                      cupsGetFd
printerqueues_unix.c:362:22: warning: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
printerqueues_unix.c: In function 'getppd':
printerqueues_unix.c:405:22: warning: initialization of 'const char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  405 |  const char *ppdname=cupsGetPPD(pq->priv->currentqueue);
      |                      ^~~~~~~~~~
  CCLD     libstp_support.la
make[2]: Leaving directory '/home/user/git/photoprint/library/stp_support'
Making all in library/gp_cppsupport
make[2]: Entering directory '/home/user/git/photoprint/library/gp_cppsupport'
make[2]: *** No rule to make target 'all'.  Stop.
make[2]: Leaving directory '/home/user/git/photoprint/library/gp_cppsupport'
make[1]: *** [Makefile:1003: all-recursive] Error 1
make[1]: Leaving directory '/home/user/git/photoprint'
make: *** [Makefile:728: all] Error 2
6543 commented 3 years ago

@robinsonb5 do you have the right to merge https://github.com/blackfiveimaging/library/pull/4 ?

robinsonb5 commented 3 years ago

Apologies, for some reason github doesn't email me when I get pull requests - but this is now merged. The other problem is going to be more difficult I think - both CUPS and Gutenprint have made major incompatible changes recently. I've moved onto other things and haven't been keeping up with either project, so I have no idea what replaces the PPD mechanism in CUPS.

6543 commented 3 years ago

oh ok ... I'll have a look at it in some weeks if I got time for that ... (then I'll ping @robinsonb5 you ;) )

6543 commented 3 years ago

@robinsonb5 just question, why not merge https://github.com/blackfiveimaging/library/pull/3 too ?

robinsonb5 commented 3 years ago

Same reason - github didn't bother to tell me about it! Merged now.
Feel free to ask if you have questions about the codebase - it's been some years since I touched it, but I should be able to dredge most of it up from the back of my memory...

javadr commented 2 years ago

The same issue, I can install it neither from AUR nor the source! Could you please help me with the issue?!

robinsonb5 commented 2 years ago

My apologies, but I'm no longer developing PhotoPrint and related software. There have been changes to GutenPrint's API, and PhotoPrint will need updating to work with it.

javadr commented 2 years ago

So sad to hear that. Your package was great and I used to apply it in printing my docs and photos.

ab1jx commented 1 year ago

Is there anything else for unix that has the mural printing ability for spanning multiple sheets of paper? Some old PageMaker versions for Mac and Windows could do it. If you want to print a picture blown up to 50 feet wide on normal paper this would do it. That and using ICM files correctly for color correction were what I used it most for. I made a hacked version that compiled and worked a few years ago but I'm not sure it survived hard drive replacements. I'm not finding it.