<p>I'm trying to use the kmeans module. Below is the example source and the error I get:</p>
<pre><code> using namespace mlpack::kmeans;
using namespace mlpack::metric;
// The dataset we are clustering.
arma::mat data(1, edges.size());
int col =0;
for(Edge& e: edges){
//std::cout<<e<<std::endl;
data(0,col) = e.weight;
col++;
}
// The number of clusters we are getting.
size_t clusters = 5;
// The centroids will be stored in this matrix.
// The assignments will be stored in this vector.
arma::Col<size_t> assignments;
// Initialize with the default arguments.
//KMeans<SquaredEuclideanDistance,RefinedStart, MaxVarianceNewCluster> k;
KMeans<> k;
//RefinedStart k;
k.Cluster(data, clusters, assignments);
for(int i =0;i<edges.size();i++){
std::cout<<edges[i].weight<<" "<<assignments(i)<<std::endl;
}
</code></pre>
<p>And I get the following linker error:</p>
<pre><code>Undefined symbols for architecture x86_64:
"mlpack::util::PrefixedOutStream::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*) (std::basic_ostream<char, std::char_traits<char> >&))", referenced from:
Graph::sparsifyGraph() in graph.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [run] Error 1
</code></pre>
<p>I get the same error whether I install mlpack with homebrew or from source. I'm using a Macbook pro with OSX 10.10 Yosemite.</p>
<p>Any help would be appreciated.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/issues/441">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFCkDW--AIcSiOhZqZ19pDtuFTneGks5oQQmDgaJpZM4E5QzN.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/issues/441"></link>
<meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>