2016-11-09 9 views
1

Ich bekomme den folgenden Fehler, nachdem ich libmlpack-dev installieren, in mein Programm aufnehmen und kompilieren.mlpack Fehler beim Erstellen

/usr/include/mlpack/methods/kmeans/kmeans_impl.hpp: In member function ‘void mlpack::kmeans::KMeans<MetricType, InitialPartitionPolicy, EmptyClusterPolicy, LloydStepType, MatType>::Cluster(const MatType&, size_t, arma::mat&, bool)’: 
/usr/include/mlpack/methods/kmeans/kmeans_impl.hpp:178:20: error: call of overloaded ‘isnan(double&)’ is ambiguous 
if (isnan(cNorm) || isinf(cNorm)) 
       ^
/usr/include/mlpack/methods/kmeans/kmeans_impl.hpp:178:20: note: candidates are: 
In file included from /usr/include/features.h:374:0, 
      from /usr/include/x86_64-linux-gnu/sys/types.h:25 

Kann jemand vorschlagen, wie man das löst.

P. S: ich das gefragt hatte in https://askubuntu.com/questions/847048/mlpack-error-while-building

Antwort

0

Dies ist ein Problem mit mlpack auf ältere Versionen von Ubuntu. Wenn Sie Ubuntu auf eine neuere Version aktualisieren und das mlpack-Paket aktualisieren, sollte das Problem behoben sein. Aber wenn Sie nicht in der Lage sind, das zu tun, können Sie direkt bearbeiten Sie die Datei /usr/include/mlpack/methods/kmeans/kmeans_impl.hpp so dass die Linie

if (isnan(cNorm) || isinf(cNorm)) 

geändert, um

if (std::isnan(cNorm) || std::isinf(cNorm)) 

und dies sollte das Problem beheben.