[mlpack] How to link c++ files with mlpack?

Jaskaran Singh jaskaranvirdi1 at gmail.com
Tue Feb 3 04:01:28 EST 2015


Hi
After installing mlpack, I tried to run the covariance example given here
http://www.mlpack.org/doxygen.php?doc=sample.html

I first tried:
$g++ covariance_comp.cpp -lmlpack

I got the error

In file included from /usr/local/include/mlpack/core.hpp:171:0,
                 from covariance_comp.cpp:2:
/usr/local/include/mlpack/core/util/save_restore_utility.hpp:26:27: fatal
error: libxml/parser.h: No such file or directory
compilation terminated.

But I already have libxml/parser.h in /usr/include/libxml2

I also tried

$g++ -I /usr/include/libxml2/ covariance_comp.cpp -lmlpack

Then I get this error
/usr/bin/ld: /tmp/cc0ARZzq.o: undefined reference to symbol 'wrapper_dgemm_'
/usr/bin/ld: note: 'wrapper_dgemm_' is defined in DSO
/usr/lib/libarmadillo.so.4 so try adding it to the linker command line
/usr/lib/libarmadillo.so.4: could not read symbols: Invalid operation
collect2: ld returned 1 exit status


*Jaskaran Singh Virdi*
*Final Year Undergrad Computer Science*
*IIT Ropar*
*GitHub:*https://github.com/jaskaran1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cc.gatech.edu/pipermail/mlpack/attachments/20150203/5b370dd8/attachment-0002.html>


More information about the mlpack mailing list