google-code-export / photivo

Automatically exported from code.google.com/p/photivo
GNU General Public License v3.0
3 stars 0 forks source link

compile error: 'unique_ptr' in namespace 'std' does not name a type #123

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hey there, 
i can't compile the sources on my x86_64. Here's what i got:

compiling ../Sources/batch/ptBatchWindow.cpp
In file included from /usr/include/qt4/QtCore/QtCore:53:0,
                 from ../Sources/ptSettings.h:27,
                 from ../Sources/batch/ptBatchWindow.cpp:25:
/usr/include/qt4/QtCore/qtconcurrentfilter.h: In function 
'QtConcurrent::ThreadEngineStarter<void> 
QtConcurrent::filterInternal(Sequence&, KeepFunctor, ReduceFunctor)':
/usr/include/qt4/QtCore/qtconcurrentfilter.h:108:47: warning: typedef 
'Iterator' locally defined but not used [-Wunused-local-typedefs]
     typedef typename Sequence::const_iterator Iterator;
                                               ^
In file included from ../Sources/ptDcRaw.h:125:0,
                 from ../Sources/ptSettings.h:31,
                 from ../Sources/batch/ptBatchWindow.cpp:25:
../Sources/ptDefines.h: At global scope:
../Sources/ptDefines.h:53:1: error: 'unique_ptr' in namespace 'std' does not 
name a type
 std::unique_ptr<T> make_unique(Args&& ...args) {
 ^
In file included from ../Sources/ptChoice.h:32:0,
                 from ../Sources/ptSettings.h:33,
                 from ../Sources/batch/ptBatchWindow.cpp:25:
../Sources/filters/ptCfgItem.h:113:5: error: 'shared_ptr' in namespace 'std' 
does not name a type
     std::shared_ptr<ptCurve>  Curve;
     ^
../Sources/filters/ptCfgItem.h:176:3: error: 'shared_ptr' in namespace 'std' 
does not name a type
   std::shared_ptr<ptCurve> Curve;
   ^
make[1]: *** [ptBatchWindow.o] Error 1
make[1]: Leaving directory 
`/home/k3nd9ue/Downloads/photivo-hg/src/photivo-build/photivoProject'
make: *** [sub-photivoProject-make_default] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

Original issue reported on code.google.com by doppelwh...@gmx.net on 5 Apr 2013 at 2:55

GoogleCodeExporter commented 9 years ago
I am having the same problem. I'm using g++ 4.8.0 for what is worth, and I 
tried changing the -std=gnu++0x to gnu++11 and c++11 but was still getting the 
same error.

Original comment by leamsi.s...@gmail.com on 6 Apr 2013 at 4:43

GoogleCodeExporter commented 9 years ago
I am thinking that the compiler is not letting you redefine __cplusplus... or 
something weird like that, maybe related to it being a double underscore define 
and therefore being reserved to the compiler??
Anyway, I fixed it with this:

diff -r 57519a52a791 Sources/ptDcRaw.h
--- a/Sources/ptDcRaw.h Sun Mar 17 12:51:10 2013 +0100
+++ b/Sources/ptDcRaw.h Sat Apr 06 11:05:41 2013 -0700
@@ -64,12 +64,11 @@
 #ifdef __cplusplus
   // This hack copes with jpeglib.h that does or doesnt provide the
   // extern internally.
-  #define ptraw_saved_cplusplus __cplusplus
-  #undef __cplusplus
+  #define DONT_USE_EXTERN_C
   extern "C" {
   #include <jpeglib.h>
   }
-  #define __cplusplus ptraw_saved_cplusplus
+  #undef DONT_USE_EXTERN_C
 #else
   #include <jpeglib.h>
 #endif

Original comment by leamsi.s...@gmail.com on 6 Apr 2013 at 6:10

GoogleCodeExporter commented 9 years ago
Ah, also in ptImage.cpp:
Here's again the full diff
$ hg diff
diff -r 57519a52a791 Sources/ptDcRaw.h
--- a/Sources/ptDcRaw.h Sun Mar 17 12:51:10 2013 +0100
+++ b/Sources/ptDcRaw.h Sat Apr 06 11:15:24 2013 -0700
@@ -64,12 +64,11 @@
 #ifdef __cplusplus
   // This hack copes with jpeglib.h that does or doesnt provide the
   // extern internally.
-  #define ptraw_saved_cplusplus __cplusplus
-  #undef __cplusplus
+  #define DONT_USE_EXTERN_C
   extern "C" {
   #include <jpeglib.h>
   }
-  #define __cplusplus ptraw_saved_cplusplus
+  #undef DONT_USE_EXTERN_C
 #else
   #include <jpeglib.h>
 #endif
diff -r 57519a52a791 Sources/ptImage.cpp
--- a/Sources/ptImage.cpp       Sun Mar 17 12:51:10 2013 +0100
+++ b/Sources/ptImage.cpp       Sat Apr 06 11:15:24 2013 -0700
@@ -46,12 +46,11 @@
 #ifdef __cplusplus
   // This hack copes with jpeglib.h that does or doesnt provide the
   // extern internally.
-  #define ptraw_saved_cplusplus __cplusplus
-  #undef __cplusplus
+  #define DONT_USE_EXTERN_C
   extern "C" {
   #include <jpeglib.h>
   }
-  #define __cplusplus ptraw_saved_cplusplus
+  #undef DONT_USE_EXTERN_C
 #else
   #include <jpeglib.h>
 #endif

Original comment by leamsi.s...@gmail.com on 6 Apr 2013 at 6:16

GoogleCodeExporter commented 9 years ago
I do have the same issue. I applied the patches suggested above, but it did not 
help (same error as in the first post occurred).

I am running Arch Linux, which is a rolling release and every package should be 
the latest greatest... 

here my installed "tools":
gcc version 4.8.0 20130411 (prerelease) (GCC)
ccache version 3.1.9
Qt4 version 4.8.4

And here my installed libraries:
libjpeg.so.62.0.0
libjpeg.so.8.0.2
libexiv2.so.12.0.0
liblensfun.so (lensfun 0.2.7-1)
libfftw3.so.3.3.2
libpng15.so.15.15.0
libtiff.so.5.2.0
liblcms2.so.2.0.4
liblqr-1.so.0.3.2

The only "suspicious" thing I notice here is that I have both libjpeg6 and 
libjpeg8. I am no expert in compiling, and don't know if this is an issue.

I had compiled Photivo before successfully, but a recent Arch Linux update 
updated qt4 (see https://www.archlinux.org/news/qt4-replaces-qt/) and forced me 
to re-install Photivo. This re-install after the update did not work and 
resulted in the compile error I pasted at the bottom of this post.

I am happy to provide more details. In fact I will do almost anything to get 
Photivo back :)

Here the full output of makepkg -i, which, after getting the source code 
through mercurial, basically just runs
qmake-qt4 PREFIX=/usr CONFIG+=WithGimp
make

---

==> Making package: photivo-hg 972-1 (Wed Apr 17 15:02:21 PDT 2013)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
==> Extracting sources...
==> Removing existing pkg/ directory...
==> Starting build()...
==> Connecting to Mercurial server....
warning: photivo.googlecode.com certificate with fingerprint 
bc:0f:42:98:b6:f1:fb:34:19:55:b2:fb:d4:df:c8:e4:b6:bb:0d:6e not verified (check 
hostfingerprints or web.cacerts config setting)
pulling from https://photivo.googlecode.com/hg/
searching for changes
no changes found
==> The local files are updated.
==> Mercurial checkout done or server timeout
==> Starting make...
Build Photivo : yes
Build ptClear : yes
Build Gimp plugin : yes
Build curves creator : no - obsolete
Build Adobe profiles creator : no
Use system CImg : no
cd ptGimpProject/ && /usr/bin/qmake-qt4 
/home/drtebi/Downloads/photivo-hg/src/photivo-build/ptGimpProject/ptGimpProject.
pro PREFIX=/usr CONFIG+=WithGimp -o Makefile
cd ptGimpProject/ && make -f Makefile 
make[1]: Entering directory 
`/home/drtebi/Downloads/photivo-hg/src/photivo-build/ptGimpProject'
compiling ../Sources/ptCalloc.cpp
In file included from /usr/include/qt4/QtCore/QtCore:53:0,
                 from ../Sources/ptCalloc.cpp:27:
/usr/include/qt4/QtCore/qtconcurrentfilter.h: In function 
‘QtConcurrent::ThreadEngineStarter<void> 
QtConcurrent::filterInternal(Sequence&, KeepFunctor, ReduceFunctor)’:
/usr/include/qt4/QtCore/qtconcurrentfilter.h:108:47: warning: typedef 
‘Iterator’ locally defined but not used [-Wunused-local-typedefs]
     typedef typename Sequence::const_iterator Iterator;
                                               ^
compiling ../Sources/ptError.cpp
compiling ../Sources/ptGimp.cpp
In file included from /usr/include/qt4/QtCore/QtCore:53:0,
                 from ../Sources/ptGimp.cpp:37:
/usr/include/qt4/QtCore/qtconcurrentfilter.h: In function 
‘QtConcurrent::ThreadEngineStarter<void> 
QtConcurrent::filterInternal(Sequence&, KeepFunctor, ReduceFunctor)’:
/usr/include/qt4/QtCore/qtconcurrentfilter.h:108:47: warning: typedef 
‘Iterator’ locally defined but not used [-Wunused-local-typedefs]
     typedef typename Sequence::const_iterator Iterator;
                                               ^
linking ../ptGimp
make[1]: Leaving directory 
`/home/drtebi/Downloads/photivo-hg/src/photivo-build/ptGimpProject'
cd ptClearProject/ && /usr/bin/qmake-qt4 
/home/drtebi/Downloads/photivo-hg/src/photivo-build/ptClearProject/ptClearProjec
t.pro PREFIX=/usr CONFIG+=WithGimp -o Makefile
cd ptClearProject/ && make -f Makefile 
make[1]: Entering directory 
`/home/drtebi/Downloads/photivo-hg/src/photivo-build/ptClearProject'
compiling ../Sources/ptClear.cpp
In file included from /usr/include/qt4/QtCore/QtCore:53:0,
                 from ../Sources/ptClear.cpp:24:
/usr/include/qt4/QtCore/qtconcurrentfilter.h: In function 
‘QtConcurrent::ThreadEngineStarter<void> 
QtConcurrent::filterInternal(Sequence&, KeepFunctor, ReduceFunctor)’:
/usr/include/qt4/QtCore/qtconcurrentfilter.h:108:47: warning: typedef 
‘Iterator’ locally defined but not used [-Wunused-local-typedefs]
     typedef typename Sequence::const_iterator Iterator;
                                               ^
linking ../ptClear
make[1]: Leaving directory 
`/home/drtebi/Downloads/photivo-hg/src/photivo-build/ptClearProject'
cd photivoProject/ && /usr/bin/qmake-qt4 
/home/drtebi/Downloads/photivo-hg/src/photivo-build/photivoProject/photivoProjec
t.pro PREFIX=/usr CONFIG+=WithGimp -o Makefile
Project MESSAGE: Building Photivo 2013-03-26 (rev 6256ff175312)
cd photivoProject/ && make -f Makefile 
make[1]: Entering directory 
`/home/drtebi/Downloads/photivo-hg/src/photivo-build/photivoProject'
uic ../Sources/batch/ptBatchWindow.ui
uic ../Sources/filemgmt/ptFileMgrWindow.ui
uic ../Sources/filters/imagespot/ptFilter_SpotTuning.ui
uic ../Sources/filters/imagespot/ptSpotListWidget.ui
uic ../Sources/filters/ptFilter_ColorIntensity.ui
uic ../Sources/filters/ptFilter_LMHRecovery.ui
uic ../Sources/filters/ptFilter_Outline.ui
uic ../Sources/filters/ptFilter_Tone.ui
uic ../Sources/filters/ptFilter_Wiener.ui
uic ../Sources/ptMainWindow.ui
compiling ../Sources/batch/ptBatchWindow.cpp
In file included from /usr/include/qt4/QtCore/QtCore:53:0,
                 from ../Sources/ptSettings.h:27,
                 from ../Sources/batch/ptBatchWindow.cpp:25:
/usr/include/qt4/QtCore/qtconcurrentfilter.h: In function 
‘QtConcurrent::ThreadEngineStarter<void> 
QtConcurrent::filterInternal(Sequence&, KeepFunctor, ReduceFunctor)’:
/usr/include/qt4/QtCore/qtconcurrentfilter.h:108:47: warning: typedef 
‘Iterator’ locally defined but not used [-Wunused-local-typedefs]
     typedef typename Sequence::const_iterator Iterator;
                                               ^
In file included from ../Sources/ptDcRaw.h:125:0,
                 from ../Sources/ptSettings.h:31,
                 from ../Sources/batch/ptBatchWindow.cpp:25:
../Sources/ptDefines.h: At global scope:
../Sources/ptDefines.h:53:1: error: ‘unique_ptr’ in namespace ‘std’ 
does not name a type
 std::unique_ptr<T> make_unique(Args&& ...args) {
 ^
In file included from ../Sources/ptChoice.h:32:0,
                 from ../Sources/ptSettings.h:33,
                 from ../Sources/batch/ptBatchWindow.cpp:25:
../Sources/filters/ptCfgItem.h:113:5: error: ‘shared_ptr’ in namespace 
‘std’ does not name a type
     std::shared_ptr<ptCurve>  Curve;
     ^
../Sources/filters/ptCfgItem.h:176:3: error: ‘shared_ptr’ in namespace 
‘std’ does not name a type
   std::shared_ptr<ptCurve> Curve;
   ^
make[1]: *** [ptBatchWindow.o] Error 1
make[1]: Leaving directory 
`/home/drtebi/Downloads/photivo-hg/src/photivo-build/photivoProject'
make: *** [sub-photivoProject-make_default] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

Original comment by drt...@gmail.com on 17 Apr 2013 at 10:08

GoogleCodeExporter commented 9 years ago
Same problem here. (Archlinux)

Original comment by npatrick...@gmail.com on 5 May 2013 at 2:19

GoogleCodeExporter commented 9 years ago
The patch posted above works flawlessly for me; thanks!

For the person who still received the original error, I think you might have 
forgotten to add the -e argument to makepkg after applying the patches to the 
source, in which case makepkg just overwrites the src directory.

Original comment by chap...@gmail.com on 16 Jun 2013 at 1:13