perl script lacking path for compiler - what compiler?

微笑、不失礼 提交于 2019-12-11 05:56:18

问题


When following the openDDS install guide I attempt to run configure from within the command prompt but receive this output:

C:\Users\Supervisor\Desktop\opendds>C:\Users\Supervisor\Desktop\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.

This error relates to this section of code within the perl script (as seen by the line number):

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";
    }
}

What compiler does it want? I have gcc and make working - they are on the system path.


回答1:


I suppose that windows does not list gcc as a naturally installed compiler.

On linux it would have worked right away.

So just add --compiler=gcc if gcc is in the path, it should work.



来源:https://stackoverflow.com/questions/38854253/perl-script-lacking-path-for-compiler-what-compiler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!