Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

std::make_unique

Andy_G_1
Beginner
1,425 Views

I'm trying to compile code c++ using Intel parallel studio xe 2016 update3 on Red Hat.

The code compiles fine under windows using VS2015 and on Linux using GCC.

The line causing problems is the following

std::unique_ptr<MyClass> myClass = std::make_unique<MyClass>();

The error generated is namespace "std" has no member "make_unique".

I've added -std=c++14 to the options which I believe is the standard option.

Any suggestions?

0 Kudos
1 Reply
Judith_W_Intel
Employee
1,425 Views

 

Intel does not distribute its own standard libraries, it uses whatever is on the system.

So the -std=c++14 will only enable c++14 compiler features, it won't change the header files.

So you need to be on a system with a version of GNU that supports std:::make_unique which I believe is GNU 4.9 or later.

https://isocpp.org/blog/2014/04/gcc-4.9.0

When you say it "compiles fine with Linux under GCC" do you mean on a different Linux operating system than the one you are using to compiler with icpc? Do a "gcc -v".

 

 

0 Kudos
Reply