Erkennen ich in einen Fehler am laufen, wenn die folgende C Kompilieren ++ Code:g ++ kompiliert nicht '*' für die Matrixmultiplikation mit Armadillo-Bibliothek
# include <iostream>
# include <armadillo>
using namespace arma;
using namespace std;
int main() {
mat A;
mat B;
mat C;
// Populating the matrices with random numbers
A.randu(3,3);
B.randu(3,3);
// Matrix multiplication
C = A * B;
cout << "Mutliplying matrices A and B:" << endl;
cout << "A * B = " << C << endl;
return 0;
}
Hier ist mein Fehler, wenn sie mit g ++ kompiliert:
Undefined symbols for architecture x86_64: "_wrapper_dgemm_", referenced from:
void arma::blas::gemm<double>(char const*, char const*, int const*, > int const*, int const*, double const*, double const*, int const*, double > const*, int const*, double const*, double*, int const*) in >armadillo_playground-aa3649.o
"_wrapper_dgemv_", referenced from:
void arma::blas::gemv<double>(char const*, int const*, int const*, >double const*, double const*, int const*, double const*, int const*, >double const*, double*, int const*) in armadillo_playground-aa3649.o
ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see >invocation)
Wenn ich die Matrixmultiplikation ersetzen '*' mit '+', '%' usw. der Code kompiliert, ohne zu klagen.
Vielen Dank im Voraus!
Sieht aus, als ob die Definition für den Operator '*' in der Quelldatei enthalten ist und Sie die Bibliothek nicht verknüpfen? –
Hoppla, ich wusste nichts von der Verknüpfung in der Bibliothek. Ich habe jetzt jedoch folgenden Fehler: dyld: Bibliothek nicht geladen: /usr/local/opt/gcc/lib/gcc/6/libgfortran.3.dylib Referenziert von:/usr/local/opt/arpack/libexec/lib/libarpack.2.dylib Grund: Bild nicht gefunden Trace/BPT-Trap: 5 –
Vielleicht hilft das? http://stackoverflow.com/questions/24993752/os-x-framework-library-not-loaded-image-not-found –