[問題] nachos multiprograming

看板C_and_CPP (C/C++)作者 (銀の風)時間14年前 (2011/10/14 20:29), 編輯推噓0(005)
留言5則, 2人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) linux 問題(Question): 因為作業需要...我從來沒有學過c++(我只會C跟python) 現在我的想法是...在address.h中的class AddrSpace下 新增一個table去紀錄記憶體使用的狀況 但在make時一直undefined reference to 想請問大概的原因是? 錯誤結果(Wrong Output): addrspace.o: In function `~AddrSpace': /home/2011OS/g03/nachos-4.0/code/userprog/../userprog/addrspace.cc:71: undefined reference to `AddrSpace::usedPhyPage' /home/2011OS/g03/nachos-4.0/code/userprog/../userprog/addrspace.cc:71: undefined reference to `AddrSpace::usedPhyPage' addrspace.o: In function `AddrSpace::Load(char*)': /home/2011OS/g03/nachos-4.0/code/userprog/../userprog/addrspace.cc:113: undefined reference to `AddrSpace::usedPhyPage' /home/2011OS/g03/nachos-4.0/code/userprog/../userprog/addrspace.cc:115: undefined reference to `AddrSpace::usedPhyPage' 程式碼(Code):(請善用置底文網頁, 記得排版) address.h http://codepad.org/aRDGwmEs address.cc http://codepad.org/KnSScYEa line 71,113,115 補充說明(Supplement): -- ※ 發信站 :批踢踢實業坊(ptt.cc) ◆ From: 118.160.66.18

10/14 20:38, , 1F
在address.cc最後加上一行
10/14 20:38, 1F

10/14 20:38, , 2F
bool AddrSpace::usedPhyPage[NumPhysPages];
10/14 20:38, 2F

10/14 20:44, , 3F
太感謝了..因為我沒寫過C++ 想請問是什麼原因啊?
10/14 20:44, 3F

10/14 20:45, , 4F
用專有名詞解釋沒關係 我會自己去查名詞..
10/14 20:45, 4F

10/14 20:46, , 5F
10/14 20:46, 5F
文章代碼(AID): #1Ec2iN7E (C_and_CPP)
文章代碼(AID): #1Ec2iN7E (C_and_CPP)