- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Hello every body,
I am woring on a mixed-Language project (Fortran DLL and C++ MFC application).
So I have one project for my MFC apps, and one for my Fortran DLL.
My MFC apps call a subroutine in the Fortran DLL (Propagate_dll). During is execution the Fortran dll have to call a function of my MFC apps to store some value. Actually when I try to compile my DLL I have this error message at link time:
Propagate_Dll.obj : error LNK2001: unresolved external symbol "public: void __cdecl CRefraDoc::StoreOrtho(float *,float *,float *,float *)" (?StoreOrtho@CRefraDoc@@QAAXPAM000@Z)
Is somebody can help me to solve this link problem? I am prety sure that it because it miste some things at my DLL, but I don't know what...
Thanks and Here is some part of my code:
The fortran DLL:
SUBROUTINE PROPAGATE_DLL(PERIOD,DELTA_T,END_CONDITION,ZOOMF,BWF)
!SUBROUTINE PROPAGATE_DLL(PERIOD,DELTA_T,END_CONDITION,ZOOMF,BWF,THIS,StoreOrtho)
!DEC$ ATTRIBUTES DLLEXPORT :: PROPAGATE_DLL
PARAMETER(I_BLAN=1)
PARAMETER(I_TEXT=2)
PARAMETER(I_COTE=3)
PARAMETER(I_BATH=4)
PARAMETER(I_LIGN=5)
interface
subroutine StoreOrtho (x,y,height,slope)
!dec$ attributes c :: StoreOrtho
!dec$ attributes alias : '?StoreOrtho@CRefraDoc@@QAAXPAM000@Z' :: StoreOrtho
DIMENSION:: x(600), y(600), height(600), slope(600)
end subroutine
end interface
...
DIMENSION xx(1),X(600),yy(1),Y(600),ALPHA(600),BETA(600),DEP(600),CEL(600),CXL(600),CYL(600),C2XL(600),C2YL(600),C2XYL(600),D_ALPHA_DT(600),SLOPE(600), HEIGHT_COEF(600)
...
...
Call StoreOrtho(X,Y,HEIGHT_COEF,SLOPE)
...
End of DLL SubRoutine
The code of the StoreOrtho Function in the MFC apps:
void __cdecl CRefraDoc::StoreOrtho(float* x, float* y, float* heightCoef, float* slope)
{
COrthogonale *newOrtho = new COrthogonale;
newOrtho->x = x;
newOrtho->y = y;
newOrtho->heightCoef = heightCoef;
newOrtho->slope = slope;
m_aOrthoArray.Add(newOrtho);
return;
}
I am woring on a mixed-Language project (Fortran DLL and C++ MFC application).
So I have one project for my MFC apps, and one for my Fortran DLL.
My MFC apps call a subroutine in the Fortran DLL (Propagate_dll). During is execution the Fortran dll have to call a function of my MFC apps to store some value. Actually when I try to compile my DLL I have this error message at link time:
Propagate_Dll.obj : error LNK2001: unresolved external symbol "public: void __cdecl CRefraDoc::StoreOrtho(float *,float *,float *,float *)" (?StoreOrtho@CRefraDoc@@QAAXPAM000@Z)
Is somebody can help me to solve this link problem? I am prety sure that it because it miste some things at my DLL, but I don't know what...
Thanks and Here is some part of my code:
The fortran DLL:
SUBROUTINE PROPAGATE_DLL(PERIOD,DELTA_T,END_CONDITION,ZOOMF,BWF)
!SUBROUTINE PROPAGATE_DLL(PERIOD,DELTA_T,END_CONDITION,ZOOMF,BWF,THIS,StoreOrtho)
!DEC$ ATTRIBUTES DLLEXPORT :: PROPAGATE_DLL
PARAMETER(I_BLAN=1)
PARAMETER(I_TEXT=2)
PARAMETER(I_COTE=3)
PARAMETER(I_BATH=4)
PARAMETER(I_LIGN=5)
interface
subroutine StoreOrtho (x,y,height,slope)
!dec$ attributes c :: StoreOrtho
!dec$ attributes alias : '?StoreOrtho@CRefraDoc@@QAAXPAM000@Z' :: StoreOrtho
DIMENSION:: x(600), y(600), height(600), slope(600)
end subroutine
end interface
...
DIMENSION xx(1),X(600),yy(1),Y(600),ALPHA(600),BETA(600),DEP(600),CEL(600),CXL(600),CYL(600),C2XL(600),C2YL(600),C2XYL(600),D_ALPHA_DT(600),SLOPE(600), HEIGHT_COEF(600)
...
...
Call StoreOrtho(X,Y,HEIGHT_COEF,SLOPE)
...
End of DLL SubRoutine
The code of the StoreOrtho Function in the MFC apps:
void __cdecl CRefraDoc::StoreOrtho(float* x, float* y, float* heightCoef, float* slope)
{
COrthogonale *newOrtho = new COrthogonale;
newOrtho->x = x;
newOrtho->y = y;
newOrtho->heightCoef = heightCoef;
newOrtho->slope = slope;
m_aOrthoArray.Add(newOrtho);
return;
}
- Etiquetas:
- Intel® Fortran Compiler
Enlace copiado
1 Responder
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Nope, that won't work. You can't link the dll with a function exported from an exe (at least not without serious hacks).
I posted a question regarding your previous attempt at a newsgroup; I hope I would get a solution soon.
I posted a question regarding your previous attempt at a newsgroup; I hope I would get a solution soon.

Responder
Opciones de temas
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla