I want to access some subroutines from a third party DLL. The functions use STDCALL as the calling convention.
Running dumpbin /export foo.dll
gives me something like:
...
7 6 00004B40 Foo@16
...
I compile my code using:
gfortran test.f90 -o test.exe -Wl,foo.dll
I get an error: undefined reference to '_foo_'
(note the underscores).
I have tried adding the -mrtd
compilation flag, as well as other flags I googled, all to no avail.
How can I tell fortran to not add the underscores?
edit: A bit of clarification is in order.
- I have an existing DLL to which I do not have the source to.
- This DLL is written in Visual Basic, if it helps.
- I want to call this DLL from fortran.
- When I write in test.f90:
Foo(1.0d0)
I get anundefined reference to '_foo_'
linkage error