Problème de link C / Fortran
Voila ce que j'ai :
Code C
Fichier .h
Code:
1 2 3
|
extern void __stdcall GETREGIMEC(int* );
extern void __stdcall GETREGIMEIT(char *,int * ); |
.c
Code:
1 2 3 4 5 6 7 8 9 10 11
|
int i=0;
int nregi=0;
char regiT[512];
strcpy(regiT,"");
GETREGIMEI(&nregi);
for(i = 0; i < nregi; i++) {
GETREGIMEIT(regiT,&i);
} |
Code .f90
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
subroutine GETREGIMEI(indice)
integer, INTENT(INOUT) :: indice
indice = 20
end
subroutine GETREGIMEIT(str, indice)
character*20, INTENT(INOUT) :: str
integer, INTENT(INOUT) :: indice
str ="Mon test";
end |
A la compilation, j'ai ceci comme erreur :
-------------------------------------------------------------
Compiling...
maFenetre.c
Linking...
maFenetre.obj : error LNK2001: unresolved external symbol _GETREGIMEIT@8
Debug/Test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Creating browse info file...
-------------------------------------------------------------
Si je met "GETREGIMEIT" en commentaire dns le .c , je compile et GETREGIMEI me donne bien la bonne valeur.
Merci d'avance pour votre aide
Cordialement