dllexport from a module

dllexport from a module

I work with CVF 6.6.A and it is the first time that I deal with DLLs

I am trying to access data in a module associated with dll.

module abc
real a
!DEC$ ATTRIBUTES DLLEXPORT :: a
end module

The dll was built successfully. Subroutines are accessible.
My check with dumpbin /exports show ABC_mp_A in the list

When I link the dll to the main code and try to access the data in the module via USE statement, I have
main.obj : error LNK2001: unresolved external symbol _ABC_mp_A

Can somebody give me an idea what is wrong?

Thanks

at

6 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

Download and install the free 6.6B update - it fixes this problem. If the problem persists, send details to vf-support@compaq.com

Steve

Steve

Thanks, Steve.

Although the update did not help, I understood from your message that I was not wrong in understanding of the concept. I have sent the samples to the support team.

Thanks again

at

I would guess that you did not link the executable against the export library (.lib) generated when the DLL was linked. This is required.

Steve

Steve

Thanks, Steve, for your suggestions

I have the link to .lib (via project-add to project-file). I can see/use subroutines from the dll. If I close reference to the parameter "a", the exe-file is generated and I can refer to a subroutine. If a reference to the parameter "a" appears in the main code, the link gives error.

I work with samples before touching my real programs.

The dll sample is
________________________
module abc
real a
!DEC$ ATTRIBUTES DLLEXPORT :: a
end module abc

SUBROUTINE test(xx)
!DEC$ ATTRIBUTES DLLEXPORT :: test
REAL XX
print*,xx
a=99.
RETURN
END SUBROUTINE
_______________________

The main code:
-----------------------
PROGRAM maintest
use abc
implicit none
REAL XX
XX=5.
call test(xx)
print*,a
END PROGRAM maintest

-------------------------
If I delete the reference to a in the main code, everything is OK

I appreciate your comments

AT

It works. I had to copy also .mod file into the executable project

Melden Sie sich an, um einen Kommentar zu hinterlassen.