Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a Fortran DLL from EXE : Pb with STDCALL

Status
Not open for further replies.

flamandier

Programmer
Sep 25, 2009
7
FR
Hi,

I try to call a fortran DLL (testdll.dll) from a Fortran Exe (testexe.exe).

In my testexe Project, I added testdll.lib.

testexe does not link well . it does not find functions in testdll.dll. Error messages areabout symbol not found.

in testdll project , subroutinetesmethod is declared and exported as :

subroutine testmethod
!DEC$ ATTRIBUTES DLLEXPORT,STDCALL::testmethod

in testexe project ,test method is imported as
!DEC$ ATTRIBUTES DLLIMPORT::testmethod


If I remove STDCALL in the testdll project, everythings links fine. Problems i that I can't do this, as STDCALL is needded (DLL is used by other projects)

How should I link my testexe.exe file in ordre to use the test.dll, without removing STDCALL attribute ?

I've tried a lot of things, and nothing works.

thanks for help
 
Try

!DEC$ ATTRIBUTES DLLIMPORT, STDCALL::testmethod
 
Yes, i tried,bur it does not work

if i put "DLLIMPORT" only , linking fails because symbol _TESTMETHOD is not found

if i put "DLLIMPORT, STDCALL", linking fails because symbol _testmethod is not found

method name in dll is "testmethod".

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top