Bonjour,
Je cherche a utiliser lapack dans un programme en C++ developpé sous windows.
Pour cela, j'ai commencé par un test : j'ai interfacé une petite librairie fortran (qui multiplie un entier par 2) avec un programme C++. Pas de problemes, ca fonctionne parfaitement.
Pour passer à l'étape suivante, j'ai selectionné les fichiers de lapack dont j'ai besoin et je les ai compiles, un a un, en .o avec g95. J'inclus ensuite les .o dans mon projet C++.
A la compilation j'ai une soixantaine d'erreur du type :
J'ai l'impression qu'il faut inclure dans mon projet des librairies internes au fortran, du type libm.a, libkernel32.a, etc...obj/Debug/dgeev.f: (.text+0xdab) undefined reference to '__g95_copy_string'
Mais mon compilateur C++ refuse toutes les librairies en .a, il n'accepte que les fichiers .o.
Quelqu'un aurait une idée ?
Voici mon code c++
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #include <iostream> using namespace std; extern "C" void dgeev_(char *jobvl, char *jobvr, int *n, int ***a, int *lda, double **wr, double **wi, double ***vl, int *ldvl, double ***vr, int *ldvr, \ double **work, int *lwork, int *info); extern void g95_runtime_start(int argc, const char *argv[]); extern void g95_runtime_stop(); int main(int argc, const char *argv[]) { g95_runtime_start(argc,argv); cout << "Hello world!" << endl; g95_runtime_stop(); return 0; }
Partager