通过visual studio 2013编译八度独立程序时出错

时间:2016-09-06 08:52:11

标签: c++ visual-studio-2013 octave

我已经从ftp://ftp.gnu.org/gnu/octave/windows/octave-4.0.3-installer.exe下载并安装了Octave for windows。我试图通过visual studio 2013运行Octave提供的独立程序之一。下面是程序

#include <iostream>
#include <octave/oct.h>

int
main (void)
{
  std::cout << "Hello Octave world!\n";

  int n = 2;
  Matrix a_matrix = Matrix (n, n);

  for (octave_idx_type i = 0; i < n; i++)
    for (octave_idx_type j = 0; j < n; j++)
      a_matrix(i,j) = (i + 1) * 10 + (j + 1);

  std::cout << a_matrix;

  return 0;
}

编译时我遇到错误

Error   1   error C2065: '__asm__' : undeclared identifier  C:\Octave\Octave-4.0.3\include\math.h   169 1   Test
Error   2   error C2146: syntax error : missing ';' before identifier '__volatile__'    C:\Octave\Octave-4.0.3\include\math.h   169 1   Test
Error   3   error C2143: syntax error : missing ')' before ':'  C:\Octave\Octave-4.0.3\include\math.h   169 1   Test
Error   4   error C2059: syntax error : ')' C:\Octave\Octave-4.0.3\include\math.h   169 1   Test

我在项目属性中正确包含了八度头文件,但我仍然遇到这些错误。有人可以帮助我吗?

0 个答案:

没有答案