[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 03:56:22 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').

The debugger gives some information:

#0 61E35145    ??() (C:\tools\msys2\mingw64\bin\libmlpack.dll:??)#1
67D0F537    ??()
(C:\tools\msys2\mingw64\bin\libboost_program_options-mt.dll:??)#2
67D1F14C    ??()
(C:\tools\msys2\mingw64\bin\libboost_program_options-mt.dll:??)#3
67D1F05F    ??()
(C:\tools\msys2\mingw64\bin\libboost_program_options-mt.dll:??)#4
67D1EF67    ??()
(C:\tools\msys2\mingw64\bin\libboost_program_options-mt.dll:??)#5
67D0E44C    ??()
(C:\tools\msys2\mingw64\bin\libboost_program_options-mt.dll:??)#6
67D0547C    ??()
(C:\tools\msys2\mingw64\bin\libboost_program_options-mt.dll:??)#7
67D05525    ??()
(C:\tools\msys2\mingw64\bin\libboost_program_options-mt.dll:??)#8
67D0F567    ??()
(C:\tools\msys2\mingw64\bin\libboost_program_options-mt.dll:??)#9
67D1F25C    ??()
(C:\tools\msys2\mingw64\bin\libboost_program_options-mt.dll:??)#10
61DB0228    ??() (C:\tools\msys2\mingw64\bin\libmlpack.dll:??)#11
61DB0439    ??() (C:\tools\msys2\mingw64\bin\libmlpack.dll:??)#12
FFFFFFFF    wcscspn() (C:\Windows\system32\msvcrt.dll:??)#13 004014DD
  ?? () (??:??)#14 0040152B    ?? () (??:??)#15 77495A4D
KERNEL32!BaseThreadInitThunk()
(C:\Windows\system32\kernel32.dll:??)#16 775CB831
ntdll!RtlUserThreadStart() (C:\Windows\SYSTEM32\ntdll.dll:??)#17 ??
?? () (??:??)

-- the offending shared libraries appear to be mlpack and
boost-program-options-mt (neither of whose code I call). After exiting, it
says
Program received signal SIGSEGV, Segmentation fault. In ?? ()
(C:\tools\msys2\mingw64\bin\libmlpack.dll)

When I remove the includes and the linker directives then the program
compiles successfully. But then of course I cannot call
rad.DoRadical(matX.t(), matY, matW);
I'm not aware of using CLIDeleter and don't even want to use it. Does
anyone know why it crashes programs without being called? Surely
CTORs/DTORs are not called just by including headers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack/attachments/20151125/0aaf56eb/attachment.html>


More information about the mlpack mailing list