我从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);
https://blog.sciencenet.cn/blog-3199-39165.html
上一篇:
电影“一一”最后洋洋说的一段话下一篇:
fatal error C1853