use4fortran
Technical User
Hello !!
I have created a fortran dll. The dll compiled successfully and gave me the ".lib" and ".dll" files. I tried to call this dll in another program and it gives me the follwing errors:
Error 1 error LNK2019: unresolved external symbol __imp__CREATEDLL referenced in function _MAIN__ testdll.obj
Error 2 fatal error LNK1120: 1 unresolved externals Debug\testdll.exe
I figured that the second error is a result of the first. But how do I get rid of the first error? Can somebody please HELP !!!
*************************************************************
!Code for dll:
subroutine createdll(message)
!dec$ attributes dllexport :: createdll
implicit real*8(a-h,o-z)
character*200 message
write(*,10) message
10 format(a100)
end subroutine
*************************************************************
! Code to use the dll
program test_dll
!dec$ attributes dllimport :: createdll
implicit real*8(a-h,o-z)
character*200 test_message
test_message = 'This is a test for creating fortran dll'
call createdll(test_message)
stop
end program
I have created a fortran dll. The dll compiled successfully and gave me the ".lib" and ".dll" files. I tried to call this dll in another program and it gives me the follwing errors:
Error 1 error LNK2019: unresolved external symbol __imp__CREATEDLL referenced in function _MAIN__ testdll.obj
Error 2 fatal error LNK1120: 1 unresolved externals Debug\testdll.exe
I figured that the second error is a result of the first. But how do I get rid of the first error? Can somebody please HELP !!!
*************************************************************
!Code for dll:
subroutine createdll(message)
!dec$ attributes dllexport :: createdll
implicit real*8(a-h,o-z)
character*200 message
write(*,10) message
10 format(a100)
end subroutine
*************************************************************
! Code to use the dll
program test_dll
!dec$ attributes dllimport :: createdll
implicit real*8(a-h,o-z)
character*200 test_message
test_message = 'This is a test for creating fortran dll'
call createdll(test_message)
stop
end program