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

Giampaolo Bellini iw2lsi at gmail.com
Mon Feb 22 14:02:08 EST 2016


Hello Nikhil,

   how do you solve the linking issue ? I'm having the same problem here
but there was no way to link...

   BTW, I'm using MSYS2 with g++.exe (Rev1, Built by MSYS2 project) 5.3.0

       thanks

             Giampaolo


2016-02-22 4:54 GMT+01:00 Nikhil Yadala <nikhil.yadala at gmail.com>:

> sorry for the unnecessary chaos, there was a problem with linking of the
> lib in my machine. Now its alright, no more problem in using mlpack
> apparently,
>
> thanks all.
>
> On Mon, Feb 22, 2016 at 9:00 AM, Nikhil Yadala <nikhil.yadala at gmail.com>
> wrote:
>
>> 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
>>>
>>
>>
>
> _______________________________________________
> mlpack mailing list
> mlpack at cc.gatech.edu
> https://mailman.cc.gatech.edu/mailman/listinfo/mlpack
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack/attachments/20160222/0b8f31ae/attachment.html>


More information about the mlpack mailing list