我正在尝试构建一个主要是C但有一些Fortran子程序的项目。代码很旧,我试图让它在现代机器上运行。我的主函数调用外部函数
extern void __stdcall mainlhs(void);
该函数是用Fortan编写的子程序
subroutine mainlhs
我想使用f2c转换Fortran代码(包含此子程序和其他子程序)并将结果放入我的项目中。
f2c会转换代码,生成的C代码会编译。当我尝试构建项目时,会出现几个链接错误。
Error 35 error LNK2019: unresolved external symbol _e_wsle referenced in function _mainlhs_ C:\Users\giazlas\Documents\Socrates Support\projects\lhsforc\lhsforc\UNCER.obj
Error 36 error LNK2019: unresolved external symbol _s_wsle referenced in function _mainlhs_ C:\Users\giazlas\Documents\Socrates Support\projects\lhsforc\lhsforc\UNCER.obj
Error 37 error LNK2019: unresolved external symbol _f_clos referenced in function _mainlhs_ C:\Users\giazlas\Documents\Socrates Support\projects\lhsforc\lhsforc\UNCER.obj
Error 38 error LNK2019: unresolved external symbol _e_rsle referenced in function _mainlhs_ C:\Users\giazlas\Documents\Socrates Support\projects\lhsforc\lhsforc\UNCER.obj
Error 39 error LNK2019: unresolved external symbol _do_lio referenced in function _mainlhs_ C:\Users\giazlas\Documents\Socrates Support\projects\lhsforc\lhsforc\UNCER.obj
Error 40 error LNK2019: unresolved external symbol _s_rsle referenced in function _mainlhs_ C:\Users\giazlas\Documents\Socrates Support\projects\lhsforc\lhsforc\UNCER.obj
Error 41 error LNK2019: unresolved external symbol _f_open referenced in function _mainlhs_ C:\Users\giazlas\Documents\Socrates Support\projects\lhsforc\lhsforc\UNCER.obj
Error 42 error LNK2019: unresolved external symbol _s_stop referenced in function _chlsky_ C:\Users\giazlas\Documents\Socrates Support\projects\lhsforc\lhsforc\UNCER.obj
Error 43 error LNK2019: unresolved external symbol _e_wsfe referenced in function _gaminv_ C:\Users\giazlas\Documents\Socrates Support\projects\lhsforc\lhsforc\UNCER.obj
Error 44 error LNK2019: unresolved external symbol _do_fio referenced in function _gaminv_ C:\Users\giazlas\Documents\Socrates Support\projects\lhsforc\lhsforc\UNCER.obj
Error 45 error LNK2019: unresolved external symbol _s_wsfe referenced in function _gaminv_ C:\Users\giazlas\Documents\Socrates Support\projects\lhsforc\lhsforc\UNCER.obj
Error 46 error LNK2019: unresolved external symbol _pow_dd referenced in function _gamcdf_ C:\Users\giazlas\Documents\Socrates Support\projects\lhsforc\lhsforc\UNCER.obj
Error 47 error LNK2019: unresolved external symbol _pow_ri referenced in function _moment_ C:\Users\giazlas\Documents\Socrates Support\projects\lhsforc\lhsforc\UNCER.obj
Error 48 error LNK2019: unresolved external symbol _s_paus referenced in function _betpdf_ C:\Users\giazlas\Documents\Socrates Support\projects\lhsforc\lhsforc\UNCER.obj
这些功能不会出现在原始的Fortran代码上,也不会出现在其他任何地方。我只在netlib的f2c
源上找到了它们的引用感谢您的帮助