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

Alle Meije Wink a.m.wink at gmail.com
Wed Nov 25 09:57:21 EST 2015


>
> > 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?

bw
Alle Meije
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack/attachments/20151125/0924e58e/attachment.html>


More information about the mlpack mailing list