no member named 'unique_ptr' in namespace 'std'

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

no member named 'unique_ptr' in namespace 'std'

dreylago
Hi community,

I just cloned the repository, followed the homebrew install instructions in OSX,  and tried to compile . The following is the very first warning and the  first error message that followed. Any help is appreciated.... thanks....
=======================================================
g++ -c -pipe -g -O2 -Wall -W -fPIC -DQT_NO_DEBUG -I../../mkspec/macports -I. -I/usr/local/Cellar/qt/4.8.7/include -I../../generated/lib/libdxfrw/moc -o ../../generated/lib/libdxfrw/obj/libdwgr.o src/libdwgr.cpp
In file included from src/dl_writer_ascii.cpp:34:
src/dl_exception.h:51:9: warning: private field 'groupCode' is not used
      [-Wunused-private-field]
    int groupCode;
        ^
1 warning generated.
g++ -c -pipe -g -std=c++11 -O2 -Wall -W -fPIC -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_SHARED -I../../mkspec/macports -I. -I/usr/local/Cellar/qt/4.8.7/lib/QtSvg.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtSvg.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/include -I../../generated/lib/jwwlib/moc -F/usr/local/Cellar/qt/4.8.7/lib -o ../../generated/lib/jwwlib/obj/dl_jww.o src/dl_jww.cpp
src/muParserTokenReader.cpp:151:10: error: no member named 'unique_ptr' in
      namespace 'std'
    std::unique_ptr<ParserTokenReader> ptr(new ParserTokenReader(*this));
    ~~~~~^
Reply | Threaded
Open this post in threaded view
|

Re: no member named 'unique_ptr' in namespace 'std'

dxli
Hi dreylago,

Just double checked: the MuParser code is correct with <memory> header for unique_ptr

You compiling command contains -std=c++11

I'm lost here, if the compiler is too old: g++-4.6 or earlier, -std=c++11 should have been rejected.

still, what's your gcc version?

g++ -v

dreylago wrote
Hi community,

I just cloned the repository, followed the homebrew install instructions in OSX,  and tried to compile . The following is the very first warning and the  first error message that followed. Any help is appreciated.... thanks....
=======================================================
g++ -c -pipe -g -O2 -Wall -W -fPIC -DQT_NO_DEBUG -I../../mkspec/macports -I. -I/usr/local/Cellar/qt/4.8.7/include -I../../generated/lib/libdxfrw/moc -o ../../generated/lib/libdxfrw/obj/libdwgr.o src/libdwgr.cpp
In file included from src/dl_writer_ascii.cpp:34:
src/dl_exception.h:51:9: warning: private field 'groupCode' is not used
      [-Wunused-private-field]
    int groupCode;
        ^
1 warning generated.
g++ -c -pipe -g -std=c++11 -O2 -Wall -W -fPIC -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_SHARED -I../../mkspec/macports -I. -I/usr/local/Cellar/qt/4.8.7/lib/QtSvg.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/lib/QtSvg.framework/Versions/4/Headers -I/usr/local/Cellar/qt/4.8.7/include -I../../generated/lib/jwwlib/moc -F/usr/local/Cellar/qt/4.8.7/lib -o ../../generated/lib/jwwlib/obj/dl_jww.o src/dl_jww.cpp
src/muParserTokenReader.cpp:151:10: error: no member named 'unique_ptr' in
      namespace 'std'
    std::unique_ptr<ParserTokenReader> ptr(new ParserTokenReader(*this));
    ~~~~~^
Reply | Threaded
Open this post in threaded view
|

Re: no member named 'unique_ptr' in namespace 'std'

dreylago
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-apple-darwin13.4.0
Configured with: ../configure --build=x86_64-apple-darwin13.4.0 --prefix=/usr/local/Cellar/gcc48/4.8.4 --libdir=/usr/local/Cellar/gcc48/4.8.4/lib/gcc/4.8 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-4.8 --with-gmp=/usr/local/opt/gmp4 --with-mpfr=/usr/local/opt/mpfr2 --with-mpc=/usr/local/opt/libmpc08 --with-cloog=/usr/local/opt/cloog018 --with-isl=/usr/local/opt/isl011 --with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew gcc48 4.8.4' --with-bugurl=https://github.com/Homebrew/homebrew-versions/issues --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 4.8.4 (Homebrew gcc48 4.8.4)




I am also confused by this... as the flags and version seem correct.
 

Reply | Threaded
Open this post in threaded view
|

Re: no member named 'unique_ptr' in namespace 'std'

dxli
One thing:

your gcc is at : /usr/local/

if it's not by MacPorts, could you try gcc from MacPorts?

dreylago wrote
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-apple-darwin13.4.0
Configured with: ../configure --build=x86_64-apple-darwin13.4.0 --prefix=/usr/local/Cellar/gcc48/4.8.4 --libdir=/usr/local/Cellar/gcc48/4.8.4/lib/gcc/4.8 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-4.8 --with-gmp=/usr/local/opt/gmp4 --with-mpfr=/usr/local/opt/mpfr2 --with-mpc=/usr/local/opt/libmpc08 --with-cloog=/usr/local/opt/cloog018 --with-isl=/usr/local/opt/isl011 --with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew gcc48 4.8.4' --with-bugurl=https://github.com/Homebrew/homebrew-versions/issues --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 4.8.4 (Homebrew gcc48 4.8.4)




I am also confused by this... as the flags and version seem correct.
Reply | Threaded
Open this post in threaded view
|

Re: no member named 'unique_ptr' in namespace 'std'

R. van Twisk
Administrator

On Sep 24, 2015, at 5:12 PM, dxli [via LibreCAD] <[hidden email]> wrote:

One thing:

your gcc is at : /usr/local/

if it's not by MacPorts, could you try gcc from MacPorts?

dreylago wrote
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-apple-darwin13.4.0
Configured with: ../configure --build=x86_64-apple-darwin13.4.0 --prefix=/usr/local/Cellar/gcc48/4.8.4 --libdir=/usr/local/Cellar/gcc48/4.8.4/lib/gcc/4.8 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-4.8 --with-gmp=/usr/local/opt/gmp4 --with-mpfr=/usr/local/opt/mpfr2 --with-mpc=/usr/local/opt/libmpc08 --with-cloog=/usr/local/opt/cloog018 --with-isl=/usr/local/opt/isl011 --with-system-zlib --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew gcc48 4.8.4' --with-bugurl=https://github.com/Homebrew/homebrew-versions/issues --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 4.8.4 (Homebrew gcc48 4.8.4)




I am also confused by this... as the flags and version seem correct.


I have seen something like this before.
Ensure you don't change your GCC to something else.

Ries
Reply | Threaded
Open this post in threaded view
|

Re: no member named 'unique_ptr' in namespace 'std'

dreylago
In reply to this post by dxli
Is it ok to mix homebrew with MacPorts gcc? my gcc was installed with homebrew. Should I uninstall it first?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: no member named 'unique_ptr' in namespace 'std'

dxli
just try any other (newer) gcc

You can also download Qt-5 (the latest version) and use clang comes with it.

dreylago wrote
Is it ok to mix homebrew with MacPorts gcc? my gcc was installed with homebrew. Should I uninstall it first?

Thanks