Cannot export subroutine: symbol not defined

140 views
Skip to first unread message

Phan

unread,
Dec 23, 2008, 6:55:35 PM12/23/08
to gg95
Hi everyone,
I'm using g95-MinGW to build a DLL call DllTest.dll
I created 2 files:
DllTest.f95:

subroutine SandProduction(E1, E3)
double precision, INTENT(IN)::E1
double precision, INTENT(OUT)::E3
if (E1==0.0) then
E3 = 1.0
else
E3 = 5.0
end if
end subroutine

DllTest.def

EXPORTS SandProduction=SandProduction_

and used command:
g95 -s -shared -mrtd -o DllTest.dll DllTest.def DllTest.f95

but it produced an error: Cannot export SandProduction_: symbol not
defined
I tried this way:
g95 -c DllTest.f95
g95 -shared -mrtd -o DllTest.dll DllTest.o
It built without errors, but I can't use the DLL in VB.NET because it
threw an exception:
System.EntryPointNotFoundException: Unable to find an entry point
named 'SandProduction' in DLL 'DllTest.dll'.

Any help, please?

Walter

unread,
Mar 6, 2015, 4:06:35 PM3/6/15
to gg...@googlegroups.com
I had the same issue. Simply switching the compiler to Gfortan it worked.
It seems to be an issue fo G95 compiler.

Walter
Reply all
Reply to author
Forward
0 new messages