[問題] expected constructor, destructor, or type conversion

看板C_and_CPP (C/C++)作者 (catching)時間13年前 (2012/08/30 16:56), 編輯推噓0(002)
留言2則, 1人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) Linux 編譯以下code出現下列的錯誤訊息: example.h:207: error: expected constructor, destructor, or type conversion before ‘*’ token example.cpp:1088: error: expected constructor, destructor, or type conversion before ‘*’ token 備註:bitvector sat_result_t為自定義資料結構 網路上有資料說是沒有引入自行定義標頭檔的的問題 但是我有確實引入了 不知道有沒有人碰過類似的問題 bitvector的定義也沒有任何的constructor, destructor 也沒有指定任何的變量: typedef struct { int length; int size; int *buffer; } bitvector; example.h: . . . 207:bitvector* getce(sat_result_t*, int); . . . example.cpp: . . . . 1088:bitvector* getce(sat_result_t* r, int num_vars){ 1089: bitvector *bv = bitvector_new(num_vars+1); 1090: int i; 1091: for(i=0;i<r->cesize;i++){ 1092: int c=*(r->counterexample+i); 1093: if(c==1){ 1094: if(i<num_vars){ 1095: bitvector_set(bv, i+1, true); 1096: } 1097: else{ 1098: } 1099: } 1100: else{ 1101: if(i<num_vars){ 1102: bitvector_set(bv, i+1, false); 1103: } 1104: else{ 1105: } 1106: } 1107: } 1108: return bv; 1109:} . . . -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.109.23.11 ※ 編輯: ykaich 來自: 140.109.23.11 (08/30 17:00)

08/30 17:07, , 1F
我好像知道原因了 makefile沒寫好.....
08/30 17:07, 1F

08/30 17:08, , 2F
沒辦法自刪文章 Orz
08/30 17:08, 2F
文章代碼(AID): #1GFogXtL (C_and_CPP)
文章代碼(AID): #1GFogXtL (C_and_CPP)