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

来源:互联网 发布:精易模块取json true 编辑:程序博客网 时间:2024/05/21 18:49

转自: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);
0 0