[問題] make test時看不到myStr2Int

看板EE_DSnP作者 (pigs5705)時間11年前 (2012/10/31 02:09), 編輯推噓2(207)
留言9則, 4人參與, 最新討論串1/1
我在make test時 他說'myStr2Int' was not declared in this scope 我知道myStr2Int是在string.cpp裡面 我是應該要自己把它include進來嗎? 還是我哪裡弄錯了呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.4.181

10/31 02:26, , 1F
哪一個檔案有用到 myStr2Int?
10/31 02:26, 1F

10/31 02:45, , 2F
calcModNum.h裡面的getStrVal不是叫我們用嗎?
10/31 02:45, 2F

10/31 09:08, , 3F
1) 把getStrVal移到.cpp定義 2) 在.h裡include "util.h"
10/31 09:08, 3F

10/31 11:26, , 4F
compile沒有error了 但我ref/testMC-64執行的結果是
10/31 11:26, 4F

10/31 11:26, , 5F
Error: using testMC <int> <int> <int>!!
10/31 11:26, 5F

10/31 11:27, , 6F
這又是哪裡出問題了嗎?
10/31 11:27, 6F

10/31 11:33, , 7F
你要打./testMC 1 2 3才行 後面要給他三個參數
10/31 11:33, 7F

10/31 11:34, , 8F
然後因為一般function會打在.cpp裡面所以.h沒有幫你
10/31 11:34, 8F

10/31 11:34, , 9F
include util.h
10/31 11:34, 9F
文章代碼(AID): #1Ga1Vh2K (EE_DSnP)