perl脚本缺少编译器的路径 - 什么编译器?

时间:2016-08-09 14:59:46

标签: perl path-variables opendds

当关注openDDS install guide时,我尝试在命令提示符下运行configure但是收到此输出:

C:\用户\主管\桌面\ opendds> C:\用户\主管\桌面\ opendds \ configure.cmd

Can't find a compiler, set PATH or run this script with the --compiler option.
For Microsoft Visual C++, run this script from the Visual Studio Command Prompt.
Stopped at configure line 336.

此错误与perl脚本中的此部分代码有关(如行号所示):

if ($opts{'compiler'}) {
    my $standard = 0;
    for my $stdcomp (@{$platforminfo{$opts{'host'}}->{'compilers'}}) {
        $standard = 1 if $opts{'compiler'} eq $stdcomp;
    }
    $opts{'nonstdcompiler'} = 1 unless $standard;
}
else {
    print "Auto-detecting compiler\n" if $opts{'verbose'};
    for my $stdcomp (@{$platforminfo{$opts{'host'}}->{'compilers'}}) {
        my $path = which($stdcomp);
        if ($path) {
            print "Found $stdcomp at: $path\n" if $opts{'verbose'};
            $opts{'compiler'} = $stdcomp;
            last;
        }
    }
    if (!defined $opts{'compiler'}) {
        die "Can't find a compiler, set PATH or run this script with the ".
        "--compiler option.\n" . ($slash eq '\\' ? "  For Microsoft Visual C++, ".
        "run this script from the Visual Studio ".
        "Command Prompt.\n" : '') . "Stopped";
    }
}

它想要什么编译器?我有gccmake工作 - 他们在系统路径上。

1 个答案:

答案 0 :(得分:3)

我认为windows不会将gcc列为自然安装的编译器。

在Linux上它会立即起作用。

如果--compiler=gcc位于路径中,只需添加gcc即可。