[mlpack] CLIDeleter problem after including mlpack and linking to the lib, but before using mlpack code
Ryan Curtin
ryan at ratml.org
Wed Nov 25 09:15:09 EST 2015
On Wed, Nov 25, 2015 at 09:56:22AM +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.)
--
Ryan Curtin | "Think! What to do!"
ryan at ratml.org | - The Master
More information about the mlpack
mailing list