[問題] 關於物件內static成員之存取LINK錯誤
開發平台(Platform):VC++
額外使用到的函數庫(Library Used):無
問題(Question):出現LINK錯誤
餵入的資料(Input):直接在主程式#include就出錯了
預期的正確結果(Expected Output):#include不出錯
錯誤結果(Wrong Output):
第一行
1>permutation_generator.obj : error LNK2001: 無法解析的外部符號 "public:
static int polynomial::_free" (?_free@polynomial@@2HA)
第二行
1>C:\Users\rush\documents\visual studio
2010\Projects\permutation_generator\Debug\permutation_generator.exe : fatal
error LNK1120: 1 個無法解析的外部符號
程式碼(Code):
http://codepad.org/sg7szY05
只要試圖對static成員做存取就會出現這個錯誤
像這樣:polynomial::_free = 0;
困擾一整天了,拜託各位幫我檢查錯誤。謝謝大家。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.171.244.35
※ 編輯: diadio 來自: 118.171.244.35 (10/03 07:05)
→
10/03 10:15, , 1F
10/03 10:15, 1F
→
10/03 11:49, , 2F
10/03 11:49, 2F
→
10/03 11:50, , 3F
10/03 11:50, 3F
→
10/03 11:50, , 4F
10/03 11:50, 4F
→
10/03 12:13, , 5F
10/03 12:13, 5F
→
10/03 12:14, , 6F
10/03 12:14, 6F
→
10/03 12:50, , 7F
10/03 12:50, 7F
→
10/03 12:51, , 8F
10/03 12:51, 8F
→
10/03 14:25, , 9F
10/03 14:25, 9F
→
10/03 16:41, , 10F
10/03 16:41, 10F
推
10/03 18:14, , 11F
10/03 18:14, 11F
→
10/04 00:36, , 12F
10/04 00:36, 12F
→
10/04 00:37, , 13F
10/04 00:37, 13F
→
10/04 09:16, , 14F
10/04 09:16, 14F
→
10/04 09:51, , 15F
10/04 09:51, 15F