clapack.h(3592) : error C2144: syntax error : 'char ' should be preceded by ') '

轉自:http://blog.sciencenet.cn/home.php?mod=space&uid=3199&do=blog&id=39165

我從http://www.netlib.org/lapack/faq.html下載 lapack-pc-wfc.zip並且成功用watcom fortran編譯出lapack.lib.
 
但是,當我試圖將該庫直接引用到我的C++工程的時候,用了相應的頭文件lapack.h,我的程序立刻出現如下諸多錯誤。
 
......\clapack.h(3592) : error C2144: syntax error : 'char ' should be preceded by ') '
 
......\clapack.h(3592) : error C2144: syntax error : 'char ' should be preceded by '; '
 
......\clapack.h(3592) : error C2143: syntax error : missing '; ' before ', '
 
......\clapack.h(3592) : error C2059: syntax error : ', '
 
......\clapack.h(3592) : error C2059: syntax error : ') '
 
於是,我查頭文件lapack.h(一行一行註釋查哪裏出錯),發現以下兩行註釋掉之後,整個工程可以編譯過,剩下只是鏈接問題。
 
/* Subroutine */ int dlabad_(doublereal *small, doublereal *large);
 
and
 
/* Subroutine */ int slabad_(real *small, real *large);
 
但是,註釋掉這兩行來讓我的代碼編過總感覺不爽。
後來發現,原來是因爲:在NpcNdr.h中有#define small char,只要將small換個變量名就可以了。
如:int slabad_(real *small_cfl, real *large);
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章