按照视频教程中的内容,在文件前面加了include,头文件是Include文件夹下的,但是出现了错误 
[Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode include 'link_fnl_static.h'
    use lin_sol_gen_int
      use rand_gen_int
     
      implicit none
! This is Example 1 for LIN_SOL_GEN.
      integer, parameter :: n=32
      real(kind(1e0)), parameter :: one=1e0
      real(kind(1e0)) err
      real(kind(1e0)) A(n,n), b(n,n), x(n,n), res(n,n), y(n**2)
      integer::i,j
! Generate a random matrix.
      call rand_gen(y)
      A = reshape(y,(/n,n/))
! Generate random right-hand sides.
      call rand_gen(y)
      b = reshape(y,(/n,n/))
! Compute the solution matrix of Ax=b.
      call lin_sol_gen(A, b, x)
      do i=1,32
          do j=1,32
              print*,A(j,i)
          enddo
    enddo     
end 
报错如下 
错误        1         error LNK2005: "void __cdecl _invalid_parameter(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invalid_parameter@@YAXPBG00II@Z) 已经在 LIBCMTD.lib(invarg.obj) 中定义        LIBCMT.lib(invarg.obj)         
 
错误        2         error LNK2005: "void __cdecl _invoke_watson(unsigned short const *,unsigned short const *,unsigned short const *,unsigned int,unsigned int)" (?_invoke_watson@@YAXPBG00II@Z) 已经在 LIBCMTD.lib(invarg.obj) 中定义        LIBCMT.lib(invarg.obj)         
 
错误        3         error LNK2005: __call_reportfault 已经在 LIBCMTD.lib(invarg.obj) 中定义        LIBCMT.lib(invarg.obj)  
等等 
 
然后我删掉了include那行,把lib下的大部分文件名都加入到工程文件的link-input下面,程序可以正常跑了。只是不知道为什么我加的这个Include这行不能正常运行呢? 
 
 |