[問題] 有關.error LNK2001
這是一個IVPAG的範例,我照著打.
PROGRAM HOMEWORK
IMPLICIT NONE
INTEGER N, NPARAM
PARAMETER (N=3, NPARAM=50)
C
C 宣告區域變數
C
INTEGER IDO, IEND, NOUT
REAL A(1,1), PARAM(NPARAM), T, TEND, TOL, Y(N)
C
C 宣告使用的副程式
C
EXTERNAL IVPAG, SSET, UMACH
C
C 宣告函數
C
EXTERNAL FCN, FCNJ
C
C 初始設定
C
CALL SSET (NPARAM, 0.0, PARAM, 1)
IDO = 1
T = 0.0
Y(1) = 0.0
Y(2) = 1.0
Y(3) = 1.0
TOL = 1.0E-6
C
C 寫入欄位名稱
C
CALL UMACH (2, NOUT)
WRITE (NOUT,99998)
C
C 對常微分方程積分
C
IEND=0
10 CONTINUE
IEND = IEND + 1
TEND = IEND
C
CALL IVPAG (IDO, N, FCN, FCNJ, A, T, TEND, TOL, PARAM, Y)
IF (IEND .LE. 10) THEN
WRITE (NOUT,99999) T, Y
C
C 迴圈結束條件
C
IF (IEND .EQ. 10) IDO = 3
C
GO TO 10
C
END IF
C
C 製作輸出表格
C
99998 FORMAT (11X, 'T', 11X, 'Y(1)', 11X, 'Y(2)', 11X, 'Y(3)')
99999 FORMAT (4F15.5)
END
C
SUBROUTINE FCN (N, X, Y, YPRIME)
C
C 宣告參數
C
INTEGER N
REAL X, Y(N), YPRIME(N)
C
YPRIME(1) = Y(2)*Y(3)
YPRIME(2) = -Y(1)*Y(3)
YPRIME(3) = -0.51*Y(1)*Y(2)
RETURN
END
C
SUBROUTINE FCNJ (N, X, Y, DYPDY)
C 宣告參數
INTEGER N
REAL X, Y(N), DYPDY(N,*)
C
RETURN
END
在compile都沒事.開始build的時候
--------------------Configuration: Text1 - Win32 Debug--------------------
Linking...
Text1.obj : error LNK2001: unresolved external symbol _SSET@16
Text1.obj : error LNK2001: unresolved external symbol _UMACH@8
Text1.obj : error LNK2001: unresolved external symbol _IVPAG@40
Debug/Text1.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
Text1.exe - 4 error(s), 0 warning(s)
上網路找大部分的答案是打錯了
不過我照原文的打.所以其實也不知道該去動哪裡..
可以幫我看看嗎=口=
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.120.29.185
→
10/01 18:29, , 1F
10/01 18:29, 1F
→
10/01 18:30, , 2F
10/01 18:30, 2F
→
10/01 18:30, , 3F
10/01 18:30, 3F
→
10/01 18:43, , 4F
10/01 18:43, 4F
→
10/01 18:44, , 5F
10/01 18:44, 5F
→
10/01 19:02, , 6F
10/01 19:02, 6F
→
10/01 19:22, , 7F
10/01 19:22, 7F
→
10/01 20:17, , 8F
10/01 20:17, 8F
→
10/01 20:18, , 9F
10/01 20:18, 9F
→
10/02 15:37, , 10F
10/02 15:37, 10F
→
10/02 17:25, , 11F
10/02 17:25, 11F
→
10/08 19:24, , 12F
10/08 19:24, 12F
→
10/08 20:50, , 13F
10/08 20:50, 13F
→
10/09 22:46, , 14F
10/09 22:46, 14F
→
10/14 12:26, , 15F
10/14 12:26, 15F
→
10/14 21:16, , 16F
10/14 21:16, 16F
Fortran 近期熱門文章
PTT數位生活區 即時熱門文章