radial.o : error LNK2001: unresolved external symbol lambda_fatal error LNK1120: 8 unresolved externals,error.failed with exit status 1120

好久不见. 提交于 2019-11-29 18:36:59

Edit: If you are using an open-source package there may be instructions for how to compile your program, what system setup is required (os, compilers), etc. There may be a "make" file that can be used.

There are many warnings/error messages here. My suggestion is to begin by making sure that the subroutines called by rad_fun are available during the build process. If the missing "utility" functions are not found in the source file with rad_fun, they should be contained in one or more separate files included with the package.

Try placing lambda_ and each of the other "utility" subroutines used by rad_fun into a module at the beginning of your source code. Then USE that module within rad_fun and attempt to compile. For example:

module my_module
  implicit none
  contains
  subroutine lambda_(arg1,arg2)
    ...
  end subroutine lambda_
end module my_module

subroutine rad_fun(arg1,arg2...)
  use my_module
  ...
end subroutine rad_fun 

radial.for first lines edited:

MODULE my_module
IMPLICIT NONE 
CONTAINS
  INCLUDE 'lib.for' 
END MODULE 
…
 SUBROUTINE rad_fun (kob, m, ne, C2, KSI0, EPS, R1f, R1d, R2f,R2d)
      USE my_module
...

command f2py -c radial.for

radial.for: so the error disappeared

After definition of subroutine

COMPLEX*16  bdc9

When I want to call function

bdc9=CMPLX(C2,0.0)
      call lambda(K,M,ne,bdc9,EPS,rlc2,ie)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!