[mlpack] CLIDeleter problem after including mlpack and linking to the lib, but before using mlpack code

Ryan Curtin ryan at ratml.org
Mon Nov 30 11:37:05 EST 2015


On Wed, Nov 25, 2015 at 03:57:21PM +0100, Alle Meije Wink wrote:
> > > During the implementation a command-line tool that uses
> > > mlpack::radical::Radical, *before putting any radical code in*, only
> > >
> > > #include "mlpack/core.hpp"#include
> > > "mlpack/methods/radical/radical.hpp"#include "armadillo"
> > >
> > > in the header file that needs it, compilation ends with the error message
> > >
> > > ||=== Build: Debug in combis (compiler: GNU GCC Compiler)
> > > ===|..\..\obj\Release\src\combis.o:combis.cpp|| undefined reference to
> > >
> > `mlpack::util::CLIDeleter::~CLIDeleter()'..\..\obj\Release\src\combis.o:combis.cpp:(.text.startup+0x14d7)||undefined
> > > reference to `mlpack::util::CLIDeleter::CLIDeleter()'
> > > error: ld returned 1 exit status||=== Build failed: 3 error(s), 0
> > > warning(s) (0 minute(s), 20 second(s)) ===|
> > >
> > > After linking to the right shared libraries, i.e. adding the linker flag
> > > -lmlpack
> > >
> > > the program compiles. But when I then run it, either from the command
> > line
> > > or in the debugger/IDE, it crashes -- even if I don't supply any options
> > > (the program only prints the 'help').
> >
> > I'm willing to bet that the issue here is that the libmlpack.dll you're
> > linking against is not built from the same version you are using as your
> > includes.
> >
> > Are there multiple libmlpack.dll files on your systems?  And are you
> > sure that C:\tools\msys2\mingw64\bin\libmlpack.dll is the same version
> > of mlpack as the version whose headers you are using in your project?
> >
> > (Aside: the CLI and CLIDeleter objects are singleton objects meant to
> > manage command-line parameters.  They always exist, regardless of
> > whether or not they are used, even if you've only included the mlpack
> > headers.)
> 
> The libmlpack.dll and the header files all come from the mlpack package
> that I installes on Msys2 -- I did not compile those myself.
> 
> In my Msys terminal window I get
> 
> $ locate libmlpack
> /mingw64/bin/libmlpack.dll
> /mingw64/lib/libmlpack.dll.a
> 
> and
> 
> $ locate core.hpp | grep '/core'
> /mingw64/include/boost/lambda/core.hpp
> /mingw64/include/boost/log/core.hpp
> /mingw64/include/boost/log/core/core.hpp
> /mingw64/include/boost/move/core.hpp
> /mingw64/include/boost/phoenix/core.hpp
> /mingw64/include/boost/proto/core.hpp
> /mingw64/include/boost/spirit/home/classic/core.hpp
> /mingw64/include/boost/spirit/home/x3/core.hpp
> /mingw64/include/mlpack/core.hpp
> 
> but in my header files I specifically include "mlpack/core.hpp".
> 
> There are no mlpack or core.hpp files outside the Msys2 directory tree (I
> checked).
> 
> The mlpack files I have installed come from the 64-bits package
> mingw-w64-x86_64-mlpack
> and I'm building with the 64 bit GCC compiler (target x86_64-w64)
> 
> Other than the files in the package not actually being 64-bits I do not
> know what else could be the case?

Hi there,

Sorry for the slow response -- it was a holiday weekend.

I don't know anything about Msys2, so I can't say whether or not mlpack
is being compiled correctly there.  But we can keep debugging... :)

You say that when you link to the right libraries, the program compiles,
but crashes when you run it.  Is it possible to get a backtrace or
anything like this to see where the program is crashing?

Another idea might be to try and compile mlpack by hand, and then link
against it, and see if the issue persists.

Thanks,

Ryan

-- 
Ryan Curtin    | "So I just, uh... I just cut them up like regular
ryan at ratml.org | chickens?" - Henry Spencer



More information about the mlpack mailing list