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

我从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);
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s