- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It works. I had to copy also .mod file into the executable project

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page