Maven不能运行程序“链接” [英] Maven cannot run program "link"
问题描述
我试图用maven和nar-maven插件来构建一个简单的C ++项目,但我得到以下错误:
无法执行目标
com.github.maven-nar:nar-maven-plugin:3.2.3:nar-validate
(default-nar-validate)在项目上it0015-cpp-executable :Could not
启动cmd.exe / X / Clink /?:执行进程时出错。不能
运行程序link:CreateProcess error = 2,系统找不到指定的
文件 - > [帮助1]
我使用Windows 8.1。有没有人有如何调查这个问题的想法?
您应该指定您使用的链接器。 b
$ b
对我来说,我使用MinGW,所以我更新我的用户路径(环境变量)与C:/ MinGW / bin和在nar-maven插件我指定链接器名称为g ++
< plugin>
< groupId> com.github.maven-nar< / groupId>
< artifactId> nar-maven-plugin< / artifactId>
< version> 3.2.3< / version>
< extensions> true< / extensions>
< configuration>
< linker>
< name> g ++< / name>
< / linker>
< libraries>
< library>
< type>可执行档< / type>
< / library>
< / libraries>
< / configuration>
< / plugin>
现在您可以启动mvn validate检查它是否工作
I am trying to build a simple C++ project with maven and the nar-maven-plugin, but I'm getting the following error:
Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.2.3:nar-validate (default-nar-validate) on project it0015-cpp-executable: Could not launch cmd.exe /X /C "link /?": Error while executing process. Cannot run program "link": CreateProcess error=2, The system cannot find the file specified -> [Help 1]
I am using Windows 8.1. Does anyone have ideas on how to investigate this issue?
you should specify the linker you are using.
For me, i'm using MinGW so i update my user path (environment variable) with C:/MinGW/bin and in the nar-maven-plugin i specify the linker name to g++
<plugin>
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.2.3</version>
<extensions>true</extensions>
<configuration>
<linker>
<name>g++</name>
</linker>
<libraries>
<library>
<type>executable</type>
</library>
</libraries>
</configuration>
</plugin>
Now you can launch "mvn validate" to check if it works
这篇关于Maven不能运行程序“链接”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!