看板 EE_DSnP 關於我們 聯絡資訊
HW#1 Prob 4 may fail to compile in some versions of Linux (e.g. RedHat Enterprise 3.0). You may see the following error message: ======== g++ -c -o circuit.o circuit.cpp In file included from bddManager.h:12, from circuit.h:15, from circuit.cpp:14: bddHash.h: In member function `void BddHash::deleteNodeInt()': bddHash.h:55: invalid use of undefined type `struct BddNodeInt' bddHash.h:16: forward declaration of `struct BddNodeInt' make: *** [circuit.o] Error 1 ======== This is because the function "deleteNodeInt()" tries to call "delete BddNodeInt", where file "bddNode.h" is not included (intended so). You can fix this by: ============== in "bddHash.h" ============== 52 #if 1 53 void deleteNodeInt(); 54 #else 55 void deleteNodeInt(){ 56 for ( int i = 0 ; i < _numBuckets; i++) 57 for ( int j = 0; j < _buckets[i].size(); j++) 58 delete _buckets[i][j]._node;} 59 #endif ^ | line number That is, don't define the function "deleteNodeInt()" inside "bddHash.h". Instead, find a .cpp file, for example, "bddManager.cpp", insert this at the end: ================= in "bddManager.h" ================= 336 337 void 338 BddHash::deleteNodeInt() 339 { 340 for ( int i = 0 ; i < _numBuckets; i++) 341 for ( int j = 0; j < _buckets[i].size(); j++) 342 delete _buckets[i][j]._node; 343 } The problem should be fixed!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.121.129.87