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

Nikhil Yadala nikhil.yadala at gmail.com
Sun Feb 21 22:30:41 EST 2016


Hi ryan,

                 I have tried that too, but the compiler shows undefined
reference to the functions that are declared in the mlpack/core.hpp. The
following error keeps coming.

       /tmp/ccagrKt9.o: In function `main':
1.cpp:(.text+0x2cc): undefined reference to
`mlpack::CLI::ParseCommandLine(int, char**)'
1.cpp:(.text+0x2d6): undefined reference to `mlpack::Log::Debug'
1.cpp:(.text+0x2f2): undefined reference to `mlpack::Log::Info'
1.cpp:(.text+0x2f7): undefined reference to
`mlpack::util::PrefixedOutStream::operator<<(char const*)'
1.cpp:(.text+0x304): undefined reference to
`mlpack::util::PrefixedOutStream::operator<<(std::ostream&
(*)(std::ostream&))'
1.cpp:(.text+0x30e): undefined reference to `mlpack::Log::Warn'
1.cpp:(.text+0x313): undefined reference to
`mlpack::util::PrefixedOutStream::operator<<(char const*)'
1.cpp:(.text+0x320): undefined reference to
`mlpack::util::PrefixedOutStream::operator<<(std::ostream&
(*)(std::ostream&))'
1.cpp:(.text+0x32a): undefined reference to `mlpack::Log::Fatal'
1.cpp:(.text+0x32f): undefined reference to
`mlpack::util::PrefixedOutStream::operator<<(char const*)'
1.cpp:(.text+0x33c): undefined reference to
`mlpack::util::PrefixedOutStream::operator<<(std::ostream&
(*)(std::ostream&))'
1.cpp:(.text+0x346): undefined reference to `mlpack::Log::Warn'
1.cpp:(.text+0x34b): undefined reference to
`mlpack::util::PrefixedOutStream::operator<<(char const*)'
1.cpp:(.text+0x358): undefined reference to
`mlpack::util::PrefixedOutStream::operator<<(std::ostream&
(*)(std::ostream&))'
/tmp/ccagrKt9.o: In function
`__static_initialization_and_destruction_0(int, int)':
1.cpp:(.text+0xbdc): undefined reference to
`mlpack::util::CLIDeleter::CLIDeleter()'
1.cpp:(.text+0xbeb): undefined reference to
`mlpack::util::CLIDeleter::~CLIDeleter()'
collect2: error: ld returned 1 exit status


thanks

On Mon, Feb 22, 2016 at 7:37 AM, Ryan Curtin <ryan at ratml.org> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cc.gatech.edu/pipermail/mlpack/attachments/20160222/30e35e2c/attachment-0002.html>


More information about the mlpack mailing list