[mlpack] cpp program using mlpack/core.hpp not getting compiled

Ryan Curtin ryan at ratml.org
Sun Feb 21 21:07:07 EST 2016


On Sun, Feb 21, 2016 at 05:26:48PM +0530, Nikhil Yadala wrote:
> I am trying to run sample programs given in the tutorials page, But i could
> not get the cpp file compiled with out errors. It seems that these are the
> errors in the library files. could nay one guide me to get rid of this and
> compile my first program using mlpack.
> 
> the following is the error the terminal shows up!
> 
> In file included from /usr/include/c++/4.8/unordered_map:35:0,
>                  from
> /usr/local/include/mlpack/core/boost_backport/unordered_map.hpp:23,
>                  from /usr/local/include/mlpack/prereqs.hpp:64,
>                  from /usr/local/include/mlpack/core.hpp:196,
>                  from 1.cpp:2:
> /usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file
> requires compiler and library support for the ISO C++ 2011 standard. This
> support is currently experimental, and must be enabled with the -std=c++11
> or -std=gnu++11 compiler options.

Hi Nikhil,

The answer is in your compiler's output:

"This file requires compiler and library support for the ISO C++ 2011
standard.  This support is currently experimental, and must be enabled
with the -std=c++11 or -std=gnu++11 compiler options."

So, add -std=c++11 to your compiler command.

-- 
Ryan Curtin    | "What? Facts?"
ryan at ratml.org |   - Joe Cairo


More information about the mlpack mailing list