Armadillo / Xcode:"仅在返回类型上有所不同的功能不能超载#34;不知道的错误

时间:2014-03-13 11:06:46

标签: c++ xcode armadillo

首先,我知道之前有过这个问题的问题,我的情况有所不同。

我正在将Armadillo矩阵库用于Xcode中的研究项目。我离项目很远,到目前为止,我没有任何问题。但是,我最近进行了一系列更改,当我尝试重新编译项目时,我得到了以下错误,尽管没有对Armadillo头文件源文件进行任何更改。

In file included from /Users/willandrew/Work/1-4th-Year/1Project/code/TPS-RPM(LAPACK)/TPS-RPM(LAPACK)/main.cpp:16:
In file included from /Users/willandrew/Work/1-4th-Year/1Project/code/TPS-RPM(LAPACK)/TPS-RPM(LAPACK)/TPS_RPM.h:19:
In file included from /Users/willandrew/Work/1-4th-Year/1Project/code/TPS-RPM(LAPACK)/TPS-RPM(LAPACK)/T_Params.h:14:
In file included from /usr/include/armadillo:121:
/usr/include/armadillo_bits/lapack_bones.hpp:239:8: error: functions that differ only in their return type cannot be overloaded
  void arma_fortran(arma_sgetrf)(blas_int* m, blas_int* n,  float* a, blas_int* lda, blas_int* ipiv, blas_int* info);
       ^
In file included from /Users/willandrew/Work/1-4th-Year/1Project/code/TPS-RPM(LAPACK)/TPS-RPM(LAPACK)/main.cpp:16:
In file included from /Users/willandrew/Work/1-4th-Year/1Project/code/TPS-RPM(LAPACK)/TPS-RPM(LAPACK)/TPS_RPM.h:19:
In file included from /Users/willandrew/Work/1-4th-Year/1Project/code/TPS-RPM(LAPACK)/TPS-RPM(LAPACK)/T_Params.h:14:
In file included from /usr/include/armadillo:42:
/usr/include/armadillo_bits/compiler_setup.hpp:36:34: note: expanded from macro 'arma_fortran'
  #define arma_fortran(function) arma_fortran2_noprefix(function)
                                 ^
/usr/include/armadillo_bits/compiler_setup.hpp:25:44: note: expanded from macro 'arma_fortran2_noprefix'
  #define arma_fortran2_noprefix(function) function##_
                                           ^
<scratch space>:203:1: note: expanded from here
sgetrf_
^

错误列表(全部类似)一直持续到Xcode停止编译,因为错误太多。我在重新编译之前所做的更改包括添加一个新类和修改一些函数定义。不幸的是,我无法撤消对每个文件所做的更改以查找错误,因为我必须重新启动计算机。我已经调查了错误,我确定我没有定义具有相同名称和不同返回类型的其他方法。

这个问题有点过分...但是有没有人对错误的含义和/或我可以尝试做什么有轻微的指示?如果您希望我添加任何源代码/其他错误并提前感谢,请告诉我

2 个答案:

答案 0 :(得分:1)

我遇到了同样的问题。当我把'犰狳&#34;标题包含在我的* .mm,* .h,* .cpp,* .hpp文件中的所有其他包含/导入之上。

#include "armadillo"
#include <stdlib.h>

答案 1 :(得分:0)

最后成功解决了这个问题,虽然我不知道问题是什么。

在我对项目进行的重大更改期间,我升级到了最新的Xcode。降级回5.0.2似乎已经解决了上述问题。警惕Xcode 5.1